public class PacketBufferBC
extends net.minecraft.network.PacketBuffer
PacketBuffer class that provides methods specific to "offset" reading and writing - like writing a
single bit to the stream, and auto-compacting it with similar bits into a single byte.| Constructor and Description |
|---|
PacketBufferBC(io.netty.buffer.ByteBuf wrapped) |
| Modifier and Type | Method and Description |
|---|---|
static PacketBufferBC |
asPacketBufferBc(io.netty.buffer.ByteBuf buf)
Returns the given
ByteBuf as PacketBufferBC. |
PacketBufferBC |
clear() |
boolean |
readBoolean()
Reads a single boolean from some position in this buffer.
|
<E extends java.lang.Enum<E>> |
readEnumValue(java.lang.Class<E> enumClass) |
int |
readFixedBits(int length) |
java.lang.String |
readString()
Reads string of any possible length
|
static PacketBufferBC |
write(IPayloadWriter writer) |
PacketBufferBC |
writeBoolean(boolean flag)
Writes a single boolean out to some position in this buffer.
|
PacketBufferBC |
writeEnumValue(java.lang.Enum<?> value) |
PacketBufferBC |
writeFixedBits(int value,
int length)
Writes a fixed number of bits out to the stream.
|
alloc, array, arrayOffset, asReadOnly, bytesBefore, bytesBefore, bytesBefore, capacity, capacity, compareTo, copy, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, getVarIntSize, hasArray, hashCode, hasMemoryAddress, indexOf, internalNioBuffer, isDirect, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxWritableBytes, memoryAddress, nioBuffer, nioBuffer, nioBufferCount, nioBuffers, nioBuffers, order, order, readableBytes, readBlockPos, readByte, readByteArray, readByteArray, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readCompoundTag, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readItemStack, readLong, readLongArray, readLongArray, readLongLE, readMedium, readMediumLE, readResourceLocation, readRetainedSlice, readShort, readShortLE, readSlice, readString, readTextComponent, readTime, readUniqueId, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, readVarInt, readVarIntArray, readVarIntArray, readVarLong, refCnt, release, release, resetReaderIndex, resetWriterIndex, retain, retain, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, setZero, skipBytes, slice, slice, toString, toString, toString, touch, touch, unwrap, writableBytes, writeBlockPos, writeByte, writeByteArray, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeCompoundTag, writeDouble, writeFloat, writeInt, writeIntLE, writeItemStack, writeLong, writeLongArray, writeLongLE, writeMedium, writeMediumLE, writeResourceLocation, writerIndex, writerIndex, writeShort, writeShortLE, writeString, writeTextComponent, writeTime, writeUniqueId, writeVarInt, writeVarIntArray, writeVarLong, writeZeropublic static PacketBufferBC asPacketBufferBc(io.netty.buffer.ByteBuf buf)
ByteBuf as PacketBufferBC. if the given instance is already a
PacketBufferBC then the given buffer is returned (note that this may result in unexpected consequences if
multiple read/write Boolean methods are called on the given buffer before you called this).public static PacketBufferBC write(IPayloadWriter writer)
public PacketBufferBC clear()
clear in class net.minecraft.network.PacketBufferpublic PacketBufferBC writeBoolean(boolean flag)
writeBoolean in class net.minecraft.network.PacketBufferpublic boolean readBoolean()
readBoolean in class net.minecraft.network.PacketBufferpublic PacketBufferBC writeFixedBits(int value, int length) throws java.lang.IllegalArgumentException
value - the value to write out.length - The number of bits to write.java.lang.IllegalArgumentException - if the length argument was less than 1 or greater than 32.public int readFixedBits(int length)
throws java.lang.IllegalArgumentException
length - java.lang.IllegalArgumentException - if the length argument was less than 1 or greater than 32.public PacketBufferBC writeEnumValue(java.lang.Enum<?> value)
writeEnumValue in class net.minecraft.network.PacketBufferpublic <E extends java.lang.Enum<E>> E readEnumValue(java.lang.Class<E> enumClass)
readEnumValue in class net.minecraft.network.PacketBufferpublic java.lang.String readString()