Suzan Cioc
Suzan Cioc

Reputation: 30097

Non-buffering StreamReader?

Is there non-buffering stream reader implementation somewhere?

I have created my streams in the following way

FileInputStream inputStream = new FileInputStream(inputFilename);
CountingInputStream countingStream = new CountingInputStream(inputStream);
InputStreamReader streamReader = new InputStreamReader(countingStream, Charset.forName("utf8"));

and countingStream indicates position 8192 from the very beginning. This means that reader reads 8192 bytes despite I am reading char by char.

Is there any reader without this feature?

CountingInputStream is from Apache Commons IO API.

Upvotes: 0

Views: 189

Answers (1)

jtahlborn
jtahlborn

Reputation: 53694

I'm not sure why you would want one (seems rather inefficient), but you could implement one yourself using CharsetDecoder.

Upvotes: 1

Related Questions