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, totalmark, markSupported, resetpublic 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 InputKryoExceptionpublic float readFloat()
throws KryoException
readFloat in class InputKryoExceptionpublic short readShort()
throws KryoException
readShort in class InputKryoExceptionpublic long readLong()
throws KryoException
readLong in class InputKryoExceptionpublic double readDouble()
throws KryoException
readDouble in class InputKryoExceptionpublic char readChar()
throws KryoException
InputreadChar in class InputKryoExceptionpublic int readInt(boolean optimizePositive)
throws KryoException
InputreadInt in class InputKryoExceptionpublic long readLong(boolean optimizePositive)
throws KryoException
InputreadLong in class InputKryoExceptionpublic 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 int[] readInts(int length)
throws KryoException
readInts in class InputKryoExceptionpublic final long[] readLongs(int length)
throws KryoException
readLongs in class InputKryoExceptionpublic final float[] readFloats(int length)
throws KryoException
readFloats in class InputKryoExceptionpublic final short[] readShorts(int length)
throws KryoException
readShorts in class InputKryoExceptionpublic final char[] readChars(int length)
throws KryoException
readChars in class InputKryoExceptionpublic final double[] readDoubles(int length)
throws KryoException
readDoubles in class InputKryoExceptionpublic final void readBytes(Object dstObj, long offset, long count) throws KryoException
KryoExceptionpublic boolean getVarIntsEnabled()
public void setVarIntsEnabled(boolean varIntsEnabled)
varIntsEnabled - Copyright © 2023. All rights reserved.