Interface NetworkBuffer
public sealed interface NetworkBuffer
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NetworkBuffer.Type<BitSet> static final NetworkBuffer.Type<Point> static final NetworkBuffer.Type<Boolean> static final NetworkBuffer.Type<Byte> static final NetworkBuffer.Type<byte[]> static final NetworkBuffer.Type<Component> static final NetworkBuffer.Type<Direction> static final NetworkBuffer.Type<Double> static final NetworkBuffer.Type<Float> static final NetworkBuffer.Type<Instant> static final NetworkBuffer.Type<Integer> static final NetworkBuffer.Type<Component> static final NetworkBuffer.Type<Key> static final NetworkBuffer.Type<Long> static final NetworkBuffer.Type<long[]> static final NetworkBuffer.Type<Vec> static final NetworkBuffer.Type<BinaryTag> static final NetworkBuffer.Type<CompoundBinaryTag> static final NetworkBuffer.Type<@Nullable Point> static final NetworkBuffer.Type<@Nullable Component> static final NetworkBuffer.Type<@Nullable Integer> static final NetworkBuffer.Type<Pos> static final NetworkBuffer.Type<EntityPose> static final NetworkBuffer.Type<PublicKey> static final NetworkBuffer.Type<float[]> static final NetworkBuffer.Type<byte[]> static final NetworkBuffer.Type<Short> static final NetworkBuffer.Type<String> static final NetworkBuffer.Type<String> static final NetworkBuffer.Type<String> static final NetworkBuffer.Type<Unit> static final NetworkBuffer.Type<Short> static final NetworkBuffer.Type<Long> static final NetworkBuffer.Type<Integer> static final NetworkBuffer.Type<UUID> static final NetworkBuffer.Type<Integer> static final NetworkBuffer.Type<Integer> static final NetworkBuffer.Type<int[]> static final NetworkBuffer.Type<Long> static final NetworkBuffer.Type<long[]> static final NetworkBuffer.Type<Point> static final NetworkBuffer.Type<Point> static final NetworkBuffer.Type<Point> static final NetworkBuffer.Type<Point> -
Method Summary
Modifier and TypeMethodDescriptionlongadvanceRead(long length) longadvanceWrite(long length) static NetworkBuffer.Builderbuilder(long size) longcapacity()voidclear()voidcompact()longcompress(long start, long length, NetworkBuffer output) default NetworkBuffercopy(long index, long length) copy(long index, long length, long readIndex, long writeIndex) static voidcopy(NetworkBuffer srcBuffer, long srcOffset, NetworkBuffer dstBuffer, long dstOffset, long length) voidcopyTo(long srcOffset, byte[] dest, long destOffset, long length) longdecompress(long start, long length, NetworkBuffer output) static <L,R> NetworkBuffer.Type <Either<L, R>> Either(NetworkBuffer.Type<L> left, NetworkBuffer.Type<R> right) voidensureWritable(long length) static <E extends Enum<E>>
NetworkBuffer.Type<E> static <E extends Enum<E>>
NetworkBuffer.Type<EnumSet<E>> static booleanequals(NetworkBuffer buffer1, NetworkBuffer buffer2) byte[]extractBytes(Consumer<NetworkBuffer> extractor) static NetworkBuffer.Type<BitSet> FixedBitSet(int length) static NetworkBuffer.Type<byte[]> FixedRawBytes(int length) index(long readIndex, long writeIndex) booleanstatic <T> NetworkBuffer.Type<T> Lazy(Supplier<NetworkBuffer.Type<T>> supplier) static byte[]makeArray(Consumer<NetworkBuffer> writing) static byte[]makeArray(Consumer<NetworkBuffer> writing, @Nullable Registries registries) static <T> byte[]makeArray(NetworkBuffer.Type<T> type, T value) static <T> byte[]makeArray(NetworkBuffer.Type<T> type, T value, @Nullable Registries registries) <T> @UnknownNullability Tread(NetworkBuffer.Type<T> type) long<T> @UnknownNullability TreadAt(long index, NetworkBuffer.Type<T> type) intreadChannel(ReadableByteChannel channel) longreadIndex(long readIndex) voidreadOnly()static NetworkBufferstatic NetworkBufferresizableBuffer(int initialSize) static NetworkBufferresizableBuffer(long initialSize, Registries registries) static NetworkBufferresizableBuffer(Registries registries) voidresize(long newSize) static NetworkBufferstaticBuffer(long size) static NetworkBufferstaticBuffer(long size, Registries registries) static <T> NetworkBuffer.Type<T> static NetworkBufferwrap(byte[] bytes, int readIndex, int writeIndex) static NetworkBufferwrap(byte[] bytes, int readIndex, int writeIndex, @Nullable Registries registries) long<T> voidwrite(NetworkBuffer.Type<T> type, @UnknownNullability T value) <T> voidwriteAt(long index, NetworkBuffer.Type<T> type, @UnknownNullability T value) booleanwriteChannel(SocketChannel channel) longwriteIndex(long writeIndex)
-
Field Details
-
UNIT
-
BOOLEAN
-
BYTE
-
UNSIGNED_BYTE
-
SHORT
-
UNSIGNED_SHORT
-
INT
-
UNSIGNED_INT
-
LONG
-
FLOAT
-
DOUBLE
-
VAR_INT
-
OPTIONAL_VAR_INT
-
VAR_INT_3
-
VAR_LONG
-
RAW_BYTES
-
STRING
-
KEY
-
STRING_TERMINATED
-
STRING_IO_UTF8
-
NBT
-
NBT_COMPOUND
-
BLOCK_POSITION
-
COMPONENT
-
JSON_COMPONENT
-
UUID
-
POS
-
BYTE_ARRAY
-
LONG_ARRAY
-
VAR_INT_ARRAY
-
VAR_LONG_ARRAY
-
BITSET
-
INSTANT_MS
-
PUBLIC_KEY
-
VECTOR3
-
VECTOR3D
-
VECTOR3I
-
VECTOR3B
-
LP_VECTOR3
-
QUATERNION
-
OPT_CHAT
-
OPT_BLOCK_POSITION
-
DIRECTION
-
POSE
-
-
Method Details
-
Enum
-
EnumSet
-
FixedBitSet
-
FixedRawBytes
-
Lazy
-
TypedNBT
-
Either
static <L,R> NetworkBuffer.Type<Either<L,R>> Either(NetworkBuffer.Type<L> left, NetworkBuffer.Type<R> right) -
write
<T> void write(NetworkBuffer.Type<T> type, @UnknownNullability T value) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
read
- Throws:
IndexOutOfBoundsException
-
writeAt
<T> void writeAt(long index, NetworkBuffer.Type<T> type, @UnknownNullability T value) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
readAt
<T> @UnknownNullability T readAt(long index, NetworkBuffer.Type<T> type) throws IndexOutOfBoundsException - Throws:
IndexOutOfBoundsException
-
copyTo
void copyTo(long srcOffset, byte[] dest, long destOffset, long length) -
extractBytes
-
clear
NetworkBuffer clear() -
writeIndex
long writeIndex() -
readIndex
long readIndex() -
writeIndex
-
readIndex
-
index
-
advanceWrite
long advanceWrite(long length) -
advanceRead
long advanceRead(long length) -
readableBytes
long readableBytes() -
writableBytes
long writableBytes() -
capacity
long capacity() -
readOnly
void readOnly() -
isReadOnly
boolean isReadOnly() -
resize
void resize(long newSize) -
ensureWritable
void ensureWritable(long length) -
compact
void compact() -
copy
-
copy
-
readChannel
- Throws:
IOException
-
writeChannel
- Throws:
IOException
-
cipher
-
compress
-
decompress
- Throws:
DataFormatException
-
registries
-
builder
-
staticBuffer
-
staticBuffer
-
resizableBuffer
-
resizableBuffer
-
resizableBuffer
-
resizableBuffer
-
wrap
static NetworkBuffer wrap(byte[] bytes, int readIndex, int writeIndex, @Nullable @Nullable Registries registries) -
wrap
-
makeArray
-
makeArray
-
makeArray
static <T> byte[] makeArray(NetworkBuffer.Type<T> type, T value, @Nullable @Nullable Registries registries) -
makeArray
-
copy
static void copy(NetworkBuffer srcBuffer, long srcOffset, NetworkBuffer dstBuffer, long dstOffset, long length) -
equals
-