public sealed interface NetworkBuffer
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static 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
<net.kyori.adventure.key.Key> static final NetworkBuffer.Type
<Long> static final NetworkBuffer.Type
<long[]> static final NetworkBuffer.Type
<net.kyori.adventure.nbt.BinaryTag> static final NetworkBuffer.Type
<net.kyori.adventure.nbt.CompoundBinaryTag> static final NetworkBuffer.Type
<@Nullable Point> static final NetworkBuffer.Type
<@Nullable Component> static final NetworkBuffer.Type
<@Nullable UUID> 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
<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 TypeMethodDescriptionlong
advanceRead
(long length) long
advanceWrite
(long length) static NetworkBuffer.Builder
builder
(long size) long
capacity()
void
clear()
void
compact()
long
compress
(long start, long length, NetworkBuffer output) default NetworkBuffer
copy
(long index, long length) copy
(long index, long length, long readIndex, long writeIndex) static void
copy
(NetworkBuffer srcBuffer, long srcOffset, NetworkBuffer dstBuffer, long dstOffset, long length) void
copyTo
(long srcOffset, byte[] dest, long destOffset, long length) long
decompress
(long start, long length, NetworkBuffer output) static <L,
R> NetworkBuffer.Type <Either<L, R>> Either
(NetworkBuffer.Type<L> left, NetworkBuffer.Type<R> right) void
ensureWritable
(long length) static <E extends Enum<E>>
NetworkBuffer.Type<E> static <E extends Enum<E>>
NetworkBuffer.Type<EnumSet<E>> static boolean
equals
(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) boolean
static <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 T
read
(NetworkBuffer.Type<T> type) long
<T> @UnknownNullability T
readAt
(long index, NetworkBuffer.Type<T> type) int
readChannel
(ReadableByteChannel channel) long
readIndex
(long readIndex) void
readOnly()
@Nullable Registries
static NetworkBuffer
static NetworkBuffer
resizableBuffer
(int initialSize) static NetworkBuffer
resizableBuffer
(long initialSize, Registries registries) static NetworkBuffer
resizableBuffer
(Registries registries) void
resize
(long newSize) static NetworkBuffer
staticBuffer
(long size) static NetworkBuffer
staticBuffer
(long size, Registries registries) static <T> NetworkBuffer.Type
<T> static NetworkBuffer
wrap
(byte[] bytes, int readIndex, int writeIndex) static NetworkBuffer
wrap
(byte[] bytes, int readIndex, int writeIndex, @Nullable Registries registries) long
<T> void
write
(NetworkBuffer.Type<T> type, @UnknownNullability T value) <T> void
writeAt
(long index, NetworkBuffer.Type<T> type, @UnknownNullability T value) boolean
writeChannel
(SocketChannel channel) long
writeIndex
(long writeIndex)
-
Field Details
-
UNIT
-
BOOLEAN
-
BYTE
-
SHORT
-
UNSIGNED_SHORT
-
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
-
QUATERNION
-
OPT_CHAT
-
OPT_BLOCK_POSITION
-
OPT_UUID
-
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
-