Questions tagged [bufferedstream]
31 questions
11
votes
4 answers
C# - StreamReader.ReadLine does not work properly!
Simply I have been trying to implement what BufferedStreamReader does in Java. I have a socket stream open and just want to read it in a line-oriented fashion - line by line.
I have the following server-code.
while (continueProcess)
{
…

Aleyna
- 1,857
- 4
- 20
- 27
10
votes
2 answers
Why would BufferedStream.Write throw "This stream does not support seek operations"?
This one puzzles me. I get an error about seek when I'm not even calling it?
I have code that looks something like this:
// send 42
uint value = 42;
byte[] msg = BitConverter.GetBytes(value);
stream.Write(msg, 0, sizeof(uint));
and I get this…

redtuna
- 4,586
- 21
- 35
4
votes
1 answer
Call finish-output from format
I noticed that there is no
format directive which would
call force-output/finish-output.
Why?
It does seem to be useful in user interaction, cf.
Lisp format and force-output.
E.g., ~= could translate to finish-output, and ~:= to force-output.
I…

sds
- 58,617
- 29
- 161
- 278
3
votes
0 answers
Convert BufferedReader To InputStream
I just finished writing a bunch of code that works fine when reading from internal resource :))))
try {
SeriesDataXMLPullParserHandler seriesDataXmlPullParserHandler = new SeriesDataXMLPullParserHandler();
entries =…

Shahrooz Andrea
- 67
- 1
- 7
2
votes
3 answers
Are there an alternative to System.IO.BufferedStream in C#?
I receive the follow exception:
System.NotSupportedException : This stream does not support seek operations.
at System.Net.Sockets.NetworkStream.Seek(Int64 offset, SeekOrigin origin)
at System.IO.BufferedStream.FlushRead()
at…

Horcrux7
- 23,758
- 21
- 98
- 156
2
votes
1 answer
BufferedStream Flush() doesn't write to MemoryStream()?
I was trying out BufferedStream over MemoryStream:
using (var ms = new MemoryStream(64))
using (var bs = new BufferedStream(ms, 32))
{
var buffer = new byte[] { 0xab, 0xab, 0xab, 0xab };
bs.Write(buffer, 0, buffer.Length);
bs.Flush();
…

Shmoopy
- 5,334
- 4
- 36
- 72
2
votes
1 answer
What is the best way to read the uploaded files from Request.Files, StreamReader or BinaryReader or BufferedStream?
I have a form where the user can upload multiple files. I am using MVC 2.0 and in my controller I need to call a webservice that is a common import interface requires the files to passed in as byte[].
.NET exposes Request.Files as a…

R N
- 73
- 4
2
votes
1 answer
How does Stream.Dispose(bool) get called by the Finalize method?
The Stream.Dispose(bool) docs say:
This method is called by the public Dispose method and the Finalize method. [..] Finalize invokes Dispose with disposing set to false.
However, neither Stream nor its super class MarshalByRefObject have a…

Evgeniy Berezovsky
- 18,571
- 13
- 82
- 156
2
votes
1 answer
Getting number of disk accesses from BufferedStream
I'm reading a binary file using BinaryReader. I want to count the number of disk accesses when buffering input with BufferedStream. Unfortunately this class is sealed, so I can't override method to count it manually.
Is there any way of doing it…

dulek
- 47
- 3
1
vote
1 answer
C# BufferedStream - Is it possible to know advancement?
I'm writing a simple checksum generator app using C# for large files. It's working quite fine, but users would like to see some sort of progress bar since the app freezes for a a few dozen seconds.
Here is a a sample of code I use (BufferedStream…

May.D
- 1,832
- 1
- 18
- 34
1
vote
2 answers
Java InputStreamReader Error (org.apache.poi.openxml4j.exceptions.InvalidOperationException)
I am trying to convert pptx files to txt (Text Extraction) using Apache POI Framework (Java).
I'm new in coding Java, so I don't know a lot about Buffered Readers/InputStream, etc.
What I tried is:
import org.apache.poi.xslf.XSLFSlideShow;
import…

Nicola
- 385
- 1
- 5
- 15
1
vote
2 answers
Why doesn't text get written to disk?
I have the following C# code:
private const int APPENDBUFFERSIZE = 65536;
private StreamWriter _streamWriter;
private FileStream _fileStream;
private BufferedStream _bufferedStream;
public void Open(string fileName)
{
_fileStream =…

MciprianM
- 513
- 1
- 7
- 18
1
vote
2 answers
FileStream and it's buffering strategy
I've found out that there is no point in using BufferedStream in conjunction with FileStream as it has it's own buffering strategy. Yet, I was wondering about one thing:
FileStream fsWithBuffer = new FileStream("buf.dat", FileMode.OpenOrCreate,
…

Paweł Poręba
- 1,084
- 1
- 14
- 37
1
vote
2 answers
Understanding Various I/O systems java
i have been reading through the java tutorials on oracle.com recently and i am trying to understand I/O. But there are so many things, a lot of which appear to be the same, such as:
Data streams
Scanner
printwriter
buffered streams
file i/o…

GHroat
- 17
- 2
0
votes
0 answers
How to search for list of keywords from text file using buffered stream I/O Java
I am new to programming and still studying in uni. I got an assignment and I am confused. I need to search for a list of keywords using Buffered Stream I/O and return the line that contains the keywords. Please help me as I don't know how to do…

Gurjit Singh
- 131
- 2
- 10