public final class FastOutput extends Output
buffer, capacity, maxCapacity, outputStream, position, total| Constructor and Description |
|---|
FastOutput()
Creates an uninitialized Output.
|
FastOutput(byte[] buffer)
Creates a new Output for writing to a byte array.
|
FastOutput(byte[] buffer,
int maxBufferSize)
Creates a new Output for writing to a byte array.
|
FastOutput(int bufferSize)
Creates a new Output for writing to a byte array.
|
FastOutput(int bufferSize,
int maxBufferSize)
Creates a new Output for writing to a byte array.
|
FastOutput(OutputStream outputStream)
Creates a new Output for writing to an OutputStream.
|
FastOutput(OutputStream outputStream,
int bufferSize)
Creates a new Output for writing to an OutputStream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
writeInt(int value,
boolean optimizePositive)
Writes a 1-5 byte int.
|
int |
writeLong(long value,
boolean optimizePositive)
Writes a 1-9 byte long.
|
clear, close, flush, getBuffer, getOutputStream, intLength, longLength, position, require, setBuffer, setBuffer, setOutputStream, setPosition, toBytes, total, write, write, write, writeAscii, writeBoolean, writeByte, writeByte, writeBytes, writeBytes, writeChar, writeChars, writeDouble, writeDouble, writeDoubles, writeFloat, writeFloat, writeFloats, writeInt, writeInts, writeInts, writeLong, writeLongs, writeLongs, writeShort, writeShorts, writeString, writeString, writeVarInt, writeVarLongpublic FastOutput()
Output.setBuffer(byte[], int) must be called before the Output is used.public FastOutput(int bufferSize)
bufferSize - The initial and maximum size of the buffer. An exception is thrown if this size is exceeded.public FastOutput(int bufferSize,
int maxBufferSize)
bufferSize - The initial size of the buffer.maxBufferSize - The buffer is doubled as needed until it exceeds maxBufferSize and an exception is thrown.public FastOutput(byte[] buffer)
Output.setBuffer(byte[])public FastOutput(byte[] buffer,
int maxBufferSize)
Output.setBuffer(byte[], int)public FastOutput(OutputStream outputStream)
public FastOutput(OutputStream outputStream, int bufferSize)
public int writeInt(int value,
boolean optimizePositive)
throws KryoException
OutputwriteInt in class OutputoptimizePositive - If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be
inefficient (5 bytes).KryoExceptionpublic int writeLong(long value,
boolean optimizePositive)
throws KryoException
OutputwriteLong in class OutputoptimizePositive - If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be
inefficient (9 bytes).KryoExceptionCopyright © 2023. All rights reserved.