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, skip
available, eof, fill, getBuffer, limit, position, setBuffer, setTotal, total
mark, markSupported, reset
public 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)
ByteBufferInput
InputStream
is set to null.setBuffer
in class ByteBufferInput
public int readInt() throws KryoException
readInt
in class ByteBufferInput
KryoException
public float readFloat() throws KryoException
readFloat
in class ByteBufferInput
KryoException
public short readShort() throws KryoException
readShort
in class ByteBufferInput
KryoException
public long readLong() throws KryoException
readLong
in class ByteBufferInput
KryoException
public boolean readBoolean() throws KryoException
readBoolean
in class ByteBufferInput
KryoException
public byte readByte() throws KryoException
readByte
in class ByteBufferInput
KryoException
public char readChar() throws KryoException
readChar
in class ByteBufferInput
KryoException
public double readDouble() throws KryoException
readDouble
in class ByteBufferInput
KryoException
public int readInt(boolean optimizePositive) throws KryoException
Input
readInt
in class ByteBufferInput
KryoException
public long readLong(boolean optimizePositive) throws KryoException
ByteBufferInput
readLong
in class ByteBufferInput
KryoException
public final int[] readInts(int length, boolean optimizePositive) throws KryoException
readInts
in class Input
KryoException
public final long[] readLongs(int length, boolean optimizePositive) throws KryoException
readLongs
in class Input
KryoException
public final float[] readFloats(int length) throws KryoException
readFloats
in class ByteBufferInput
KryoException
public final short[] readShorts(int length) throws KryoException
readShorts
in class ByteBufferInput
KryoException
public final char[] readChars(int length) throws KryoException
readChars
in class ByteBufferInput
KryoException
public final double[] readDoubles(int length) throws KryoException
readDoubles
in class ByteBufferInput
KryoException
public byte[] readBytes(int length) throws KryoException
readBytes
in class ByteBufferInput
KryoException
public final void readBytes(Object dstObj, long offset, long count) throws KryoException
KryoException
Copyright © 2018. All rights reserved.