public final class UnsafeInput extends Input
Constructor and Description |
---|
UnsafeInput()
Creates an uninitialized Input.
|
UnsafeInput(byte[] buffer)
Creates a new Input for reading from a byte array.
|
UnsafeInput(byte[] buffer,
int offset,
int count)
Creates a new Input for reading from a byte array.
|
UnsafeInput(InputStream inputStream)
Creates a new Input for reading from an InputStream.
|
UnsafeInput(InputStream inputStream,
int bufferSize)
Creates a new Input for reading from an InputStream.
|
UnsafeInput(int bufferSize)
Creates a new Input for reading from a byte array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getVarIntsEnabled()
Return current setting for variable length encoding of integers
|
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()
Writes 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)
Bulk input of an int array.
|
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)
Bulk input of a long array.
|
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 |
setVarIntsEnabled(boolean varIntsEnabled)
Controls if a variable length encoding for integer types should be used when serializers suggest it.
|
available, canReadInt, canReadLong, close, eof, fill, getBuffer, getInputStream, limit, position, read, read, read, readBoolean, readByte, readBytes, readBytes, readBytes, readByteUnsigned, readDouble, readFloat, readShortUnsigned, readString, readStringBuilder, readVarInt, readVarLong, require, rewind, setBuffer, setBuffer, setInputStream, setLimit, setPosition, setTotal, skip, skip, total
mark, markSupported, reset
public UnsafeInput()
Input.setBuffer(byte[], int, int)
must be called before the Input is used.public UnsafeInput(int bufferSize)
bufferSize
- The initial and maximum size of the buffer. An exception is thrown if this size is exceeded.public UnsafeInput(byte[] buffer)
Input.setBuffer(byte[])
public UnsafeInput(byte[] buffer, int offset, int count)
Input.setBuffer(byte[], int, int)
public UnsafeInput(InputStream inputStream)
public UnsafeInput(InputStream inputStream, int bufferSize)
public int readInt() throws KryoException
readInt
in class Input
KryoException
public float readFloat() throws KryoException
readFloat
in class Input
KryoException
public short readShort() throws KryoException
readShort
in class Input
KryoException
public long readLong() throws KryoException
readLong
in class Input
KryoException
public double readDouble() throws KryoException
readDouble
in class Input
KryoException
public char readChar() throws KryoException
Input
readChar
in class Input
KryoException
public int readInt(boolean optimizePositive) throws KryoException
Input
readInt
in class Input
KryoException
public long readLong(boolean optimizePositive) throws KryoException
Input
readLong
in class Input
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 int[] readInts(int length) throws KryoException
readInts
in class Input
KryoException
public final long[] readLongs(int length) throws KryoException
readLongs
in class Input
KryoException
public final float[] readFloats(int length) throws KryoException
readFloats
in class Input
KryoException
public final short[] readShorts(int length) throws KryoException
readShorts
in class Input
KryoException
public final char[] readChars(int length) throws KryoException
readChars
in class Input
KryoException
public final double[] readDoubles(int length) throws KryoException
readDoubles
in class Input
KryoException
public final void readBytes(Object dstObj, long offset, long count) throws KryoException
KryoException
public boolean getVarIntsEnabled()
public void setVarIntsEnabled(boolean varIntsEnabled)
varIntsEnabled
- Copyright © 2018. All rights reserved.