public class InputStreamBufferInput extends Object implements BufferInput<BufferInput<?>>
| Constructor and Description |
|---|
InputStreamBufferInput(DataInputStream is) |
InputStreamBufferInput(InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasRemaining()
Returns a boolean value indicating whether the input has bytes remaining.
|
BufferInput<?> |
read(Buffer buffer)
Reads bytes into the given buffer.
|
BufferInput<?> |
read(byte[] bytes)
Reads bytes into the given byte array.
|
BufferInput<?> |
read(byte[] bytes,
long offset,
long length)
Reads bytes into the given byte array starting at current position up to the given length.
|
BufferInput<?> |
read(Bytes bytes)
Reads bytes into the given byte array.
|
BufferInput<?> |
read(Bytes bytes,
long offset,
long length)
Reads bytes into the given byte array starting at the current position.
|
boolean |
readBoolean()
Reads a 1 byte boolean from the buffer at the current position.
|
int |
readByte()
Reads a byte from the buffer at the current position.
|
char |
readChar()
Reads a 16-bit character from the buffer at the current position.
|
double |
readDouble()
Reads a double-precision 64-bit floating point number from the buffer at the current position.
|
float |
readFloat()
Reads a single-precision 32-bit floating point number from the buffer at the current position.
|
int |
readInt()
Reads a 32-bit signed integer from the buffer at the current position.
|
long |
readLong()
Reads a 64-bit signed integer from the buffer at the current position.
|
int |
readMedium()
Reads a 24-bit signed integer from the buffer at the current position.
|
short |
readShort()
Reads a 16-bit signed integer from the buffer at the current position.
|
String |
readString()
Reads a string from the buffer at the current position.
|
int |
readUnsignedByte()
Reads an unsigned byte from the buffer at the current position.
|
long |
readUnsignedInt()
Reads a 32-bit unsigned integer from the buffer at the current position.
|
int |
readUnsignedMedium()
Reads a 24-bit unsigned integer from the buffer at the current position.
|
int |
readUnsignedShort()
Reads a 16-bit unsigned integer from the buffer at the current position.
|
String |
readUTF8()
Reads a UTF-8 string from the buffer at the current position.
|
long |
remaining()
Returns the number of bytes remaining in the input.
|
BufferInput<?> |
skip(long bytes)
Skips the given number of bytes in the input.
|
public InputStreamBufferInput(InputStream is)
public InputStreamBufferInput(DataInputStream is)
public long remaining()
BufferInputremaining in interface BufferInput<BufferInput<?>>public boolean hasRemaining()
BufferInputhasRemaining in interface BufferInput<BufferInput<?>>public BufferInput<?> skip(long bytes)
BufferInputskip in interface BufferInput<BufferInput<?>>bytes - The number of bytes to attempt to skip.public BufferInput<?> read(Bytes bytes)
BufferInputread in interface BufferInput<BufferInput<?>>bytes - The byte array into which to read bytes.public BufferInput<?> read(byte[] bytes)
BufferInputread in interface BufferInput<BufferInput<?>>bytes - The byte array into which to read bytes.public BufferInput<?> read(Bytes bytes, long offset, long length)
BufferInputread in interface BufferInput<BufferInput<?>>bytes - The byte array into which to read bytes.offset - The offset at which to write bytes into the given bufferpublic BufferInput<?> read(byte[] bytes, long offset, long length)
BufferInputread in interface BufferInput<BufferInput<?>>bytes - The byte array into which to read bytes.offset - The offset at which to write bytes into the given bufferpublic BufferInput<?> read(Buffer buffer)
BufferInputread in interface BufferInput<BufferInput<?>>buffer - The buffer into which to read bytes.public int readByte()
BufferInputreadByte in interface BufferInput<BufferInput<?>>public int readUnsignedByte()
BufferInputreadUnsignedByte in interface BufferInput<BufferInput<?>>public char readChar()
BufferInputreadChar in interface BufferInput<BufferInput<?>>public short readShort()
BufferInputreadShort in interface BufferInput<BufferInput<?>>public int readUnsignedShort()
BufferInputreadUnsignedShort in interface BufferInput<BufferInput<?>>public int readMedium()
BufferInputreadMedium in interface BufferInput<BufferInput<?>>public int readUnsignedMedium()
BufferInputreadUnsignedMedium in interface BufferInput<BufferInput<?>>public int readInt()
BufferInputreadInt in interface BufferInput<BufferInput<?>>public long readUnsignedInt()
BufferInputreadUnsignedInt in interface BufferInput<BufferInput<?>>public long readLong()
BufferInputreadLong in interface BufferInput<BufferInput<?>>public float readFloat()
BufferInputreadFloat in interface BufferInput<BufferInput<?>>public double readDouble()
BufferInputreadDouble in interface BufferInput<BufferInput<?>>public boolean readBoolean()
BufferInputreadBoolean in interface BufferInput<BufferInput<?>>public String readString()
BufferInputreadString in interface BufferInput<BufferInput<?>>public String readUTF8()
BufferInputreadUTF8 in interface BufferInput<BufferInput<?>>public void close()
close in interface BufferInput<BufferInput<?>>close in interface AutoCloseableCopyright © 2013–2016. All rights reserved.