Package org.h2.store
Class CountingReaderInputStream
java.lang.Object
java.io.InputStream
org.h2.store.CountingReaderInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
An input stream that reads the data from a reader and limits the number of
bytes that can be read.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBuffer
private final CharBuffer
private final CharsetEncoder
private long
private final Reader
private long
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
reader
-
charBuffer
-
encoder
-
byteBuffer
-
length
private long length -
remaining
private long remaining
-
-
Constructor Details
-
CountingReaderInputStream
-
-
Method Details
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
fetch
- Throws:
IOException
-
fillBuffer
- Throws:
IOException
-
getLength
public long getLength()The number of characters read so far (but there might still be some bytes in the buffer).- Returns:
- the number of characters
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-