public final class UnsafeMemoryInput extends ByteBufferInput
Important notes:
nativeOrder, niobuffer, varIntsEnabled| Constructor and Description |
|---|
UnsafeMemoryInput()
Creates an uninitialized Input.
|
UnsafeMemoryInput(byte[] buffer)
Creates a new Input for reading from a byte array.
|
UnsafeMemoryInput(ByteBuffer buffer) |
UnsafeMemoryInput(InputStream inputStream)
Creates a new Input for reading from an InputStream.
|
UnsafeMemoryInput(InputStream inputStream,
int bufferSize)
Creates a new Input for reading from an InputStream.
|
UnsafeMemoryInput(int bufferSize)
Creates a new Input for reading from a byte array.
|
UnsafeMemoryInput(long address,
int maxBufferSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
readBoolean()
Reads a 1 byte boolean.
|
byte |
readByte()
Reads a single byte.
|
byte[] |
readBytes(int length)
Reads the specified number of bytes into a new byte[].
|
void |
readBytes(Object dstObj,
long offset,
long count) |
char |
readChar()
Reads a 2 byte char.
|
char[] |
readChars(int length)
Bulk input of a char array.
|
double |
readDouble()
Reads an 8 byte double.
|
double[] |
readDoubles(int length)
Bulk input of a double array.
|
float |
readFloat()
Reads a 4 byte float.
|
float[] |
readFloats(int length)
Bulk input of a float array.
|
int |
readInt()
Reads a 4 byte int.
|
int |
readInt(boolean optimizePositive)
Reads a 1-5 byte int.
|
int[] |
readInts(int length,
boolean optimizePositive)
Bulk input of an int array.
|
long |
readLong()
Reads an 8 byte long.
|
long |
readLong(boolean optimizePositive)
Reads a 1-9 byte long.
|
long[] |
readLongs(int length,
boolean optimizePositive)
Bulk input of a long array.
|
short |
readShort()
Reads a 2 byte short.
|
short[] |
readShorts(int length)
Bulk input of a short array.
|
void |
setBuffer(ByteBuffer buffer)
Sets a new buffer, discarding any previous buffer.
|
canReadInt, canReadLong, close, fill, getByteBuffer, getInputStream, getVarIntsEnabled, order, order, read, read, read, readBytes, readBytes, readByteUnsigned, readDouble, readFloat, readInts, readLongs, readShortUnsigned, readString, readStringBuilder, readVarInt, readVarLong, release, require, rewind, setBuffer, setInputStream, setLimit, setPosition, setVarIntsEnabled, skip, skipavailable, eof, fill, getBuffer, limit, position, setBuffer, setTotal, totalmark, markSupported, resetpublic UnsafeMemoryInput()
Input.setBuffer(byte[], int, int) must be called before the Input is used.public UnsafeMemoryInput(int bufferSize)
bufferSize - The initial and maximum size of the buffer. An exception is thrown if this size is exceeded.public UnsafeMemoryInput(byte[] buffer)
ByteBufferInput.setBuffer(byte[])public UnsafeMemoryInput(ByteBuffer buffer)
public UnsafeMemoryInput(long address,
int maxBufferSize)
public UnsafeMemoryInput(InputStream inputStream)
public UnsafeMemoryInput(InputStream inputStream, int bufferSize)
public void setBuffer(ByteBuffer buffer)
ByteBufferInputInputStream is set to null.setBuffer in class ByteBufferInputpublic int readInt()
throws KryoException
readInt in class ByteBufferInputKryoExceptionpublic float readFloat()
throws KryoException
readFloat in class ByteBufferInputKryoExceptionpublic short readShort()
throws KryoException
readShort in class ByteBufferInputKryoExceptionpublic long readLong()
throws KryoException
readLong in class ByteBufferInputKryoExceptionpublic boolean readBoolean()
throws KryoException
readBoolean in class ByteBufferInputKryoExceptionpublic byte readByte()
throws KryoException
readByte in class ByteBufferInputKryoExceptionpublic char readChar()
throws KryoException
readChar in class ByteBufferInputKryoExceptionpublic double readDouble()
throws KryoException
readDouble in class ByteBufferInputKryoExceptionpublic int readInt(boolean optimizePositive)
throws KryoException
InputreadInt in class ByteBufferInputKryoExceptionpublic long readLong(boolean optimizePositive)
throws KryoException
ByteBufferInputreadLong in class ByteBufferInputKryoExceptionpublic final int[] readInts(int length,
boolean optimizePositive)
throws KryoException
readInts in class InputKryoExceptionpublic final long[] readLongs(int length,
boolean optimizePositive)
throws KryoException
readLongs in class InputKryoExceptionpublic final float[] readFloats(int length)
throws KryoException
readFloats in class ByteBufferInputKryoExceptionpublic final short[] readShorts(int length)
throws KryoException
readShorts in class ByteBufferInputKryoExceptionpublic final char[] readChars(int length)
throws KryoException
readChars in class ByteBufferInputKryoExceptionpublic final double[] readDoubles(int length)
throws KryoException
readDoubles in class ByteBufferInputKryoExceptionpublic byte[] readBytes(int length)
throws KryoException
readBytes in class ByteBufferInputKryoExceptionpublic final void readBytes(Object dstObj, long offset, long count) throws KryoException
KryoExceptionCopyright © 2023. All rights reserved.