Javolution 6.0.0 java
|
Public Member Functions | |
UTF8ByteBufferReader () | |
UTF8ByteBufferReader | setInput (ByteBuffer byteBuffer) |
boolean | ready () throws IOException |
void | close () throws IOException |
int | read () throws IOException |
int | read (char cbuf[], int off, int len) throws IOException |
void | read (Appendable dest) throws IOException |
void | reset () |
UTF8ByteBufferReader | setByteBuffer (ByteBuffer byteBuffer) |
Private Member Functions | |
int | read2 (byte b) throws IOException |
Private Attributes | |
ByteBuffer | _byteBuffer |
int | _code |
int | _moreBytes |
A UTF-8 java.nio.ByteBuffer
reader.
This reader can be used for efficient decoding of native byte buffers (e.g. MappedByteBuffer
), high-performance messaging (no intermediate buffer), etc.
This reader supports surrogate char
pairs (representing characters in the range [U+10000 .. U+10FFFF]). It can also be used to read characters unicodes (31 bits) directly (ref. read()).
Each invocation of one of the read()
methods may cause one or more bytes to be read from the underlying byte buffer. The end of stream is reached when the byte buffer position and limit coincide.
Definition at line 39 of file UTF8ByteBufferReader.java.
javolution.io.UTF8ByteBufferReader.UTF8ByteBufferReader | ( | ) |
void javolution.io.UTF8ByteBufferReader.close | ( | ) | throws IOException |
Closes and resets this reader for reuse.
IOException | if an I/O error occurs. |
Definition at line 87 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer, and javolution.io.UTF8ByteBufferReader.reset().
int javolution.io.UTF8ByteBufferReader.read | ( | ) | throws IOException |
Reads a single character. This method does not block, -1
is returned if the buffer's limit has been reached.
IOException | if an I/O error occurs (e.g. incomplete character sequence being read). |
Definition at line 102 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer, and javolution.io.UTF8ByteBufferReader.read2().
Referenced by javolution.io.Struct.UTF8String.get().
void javolution.io.UTF8ByteBufferReader.read | ( | Appendable | dest | ) | throws IOException |
Reads characters into the specified appendable. This method does not block.
Note: Characters between U+10000 and U+10FFFF are represented by surrogate pairs (two char
).
dest | the destination buffer. |
IOException | if an I/O error occurs. |
Definition at line 231 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer, and javolution.io.UTF8ByteBufferReader.read2().
int javolution.io.UTF8ByteBufferReader.read | ( | char | cbuf[], |
int | off, | ||
int | len | ||
) | throws IOException |
Reads characters into a portion of an array. This method does not block.
Note: Characters between U+10000 and U+10FFFF are represented by surrogate pairs (two char
).
cbuf | the destination buffer. |
off | the offset at which to start storing characters. |
len | the maximum number of characters to read |
IOException | if an I/O error occurs. |
Definition at line 181 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer, and javolution.io.UTF8ByteBufferReader.read2().
|
private |
Definition at line 116 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer, javolution.io.UTF8ByteBufferReader._code, and javolution.io.UTF8ByteBufferReader._moreBytes.
Referenced by javolution.io.UTF8ByteBufferReader.read().
boolean javolution.io.UTF8ByteBufferReader.ready | ( | ) | throws IOException |
Indicates if this stream is ready to be read.
true
if the byte buffer has remaining bytes to read; false
otherwise. IOException | if an I/O error occurs. |
Definition at line 74 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer.
void javolution.io.UTF8ByteBufferReader.reset | ( | ) |
Definition at line 254 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer, javolution.io.UTF8ByteBufferReader._code, and javolution.io.UTF8ByteBufferReader._moreBytes.
Referenced by javolution.io.UTF8ByteBufferReader.close(), and javolution.io.Struct.UTF8String.get().
UTF8ByteBufferReader javolution.io.UTF8ByteBufferReader.setByteBuffer | ( | ByteBuffer | byteBuffer | ) |
Definition at line 263 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader.setInput().
UTF8ByteBufferReader javolution.io.UTF8ByteBufferReader.setInput | ( | ByteBuffer | byteBuffer | ) |
Sets the ByteBuffer
to use for reading available bytes from current buffer position.
byteBuffer | the ByteBuffer source. |
Definition at line 60 of file UTF8ByteBufferReader.java.
References javolution.io.UTF8ByteBufferReader._byteBuffer.
Referenced by javolution.io.Struct.UTF8String.get(), and javolution.io.UTF8ByteBufferReader.setByteBuffer().
|
private |
Holds the byte buffer source.
Definition at line 44 of file UTF8ByteBufferReader.java.
Referenced by javolution.io.UTF8ByteBufferReader.close(), javolution.io.UTF8ByteBufferReader.read(), javolution.io.UTF8ByteBufferReader.read2(), javolution.io.UTF8ByteBufferReader.ready(), javolution.io.UTF8ByteBufferReader.reset(), and javolution.io.UTF8ByteBufferReader.setInput().
|
private |
Definition at line 163 of file UTF8ByteBufferReader.java.
Referenced by javolution.io.UTF8ByteBufferReader.read2(), and javolution.io.UTF8ByteBufferReader.reset().
|
private |
Definition at line 165 of file UTF8ByteBufferReader.java.
Referenced by javolution.io.UTF8ByteBufferReader.read2(), and javolution.io.UTF8ByteBufferReader.reset().