Class NettyByteBufAdapter
java.lang.Object
io.netty.buffer.ByteBuf
io.netty.buffer.AbstractByteBuf
com.comphenix.protocol.injector.netty.NettyByteBufAdapter
- All Implemented Interfaces:
io.netty.util.ReferenceCounted,Comparable<io.netty.buffer.ByteBuf>
public class NettyByteBufAdapter
extends io.netty.buffer.AbstractByteBuf
Construct a ByteBuf around an input stream and an output stream.
Note that as streams usually don't support seeking, this implementation will ignore all indexing in the byte buffer.
-
Method Summary
Modifier and TypeMethodDescriptionprotected byte_getByte(int paramInt) protected int_getInt(int paramInt) protected int_getIntLE(int arg0) protected long_getLong(int paramInt) protected long_getLongLE(int arg0) protected short_getShort(int paramInt) protected short_getShortLE(int arg0) protected int_getUnsignedMedium(int paramInt) protected int_getUnsignedMediumLE(int arg0) protected void_setByte(int index, int value) protected void_setInt(int index, int value) protected void_setIntLE(int arg0, int arg1) protected void_setLong(int index, long value) protected void_setLongLE(int arg0, long arg1) protected void_setMedium(int index, int value) protected void_setMediumLE(int arg0, int arg1) protected void_setShort(int index, int value) protected void_setShortLE(int arg0, int arg1) io.netty.buffer.ByteBufAllocatoralloc()byte[]array()intintcapacity()io.netty.buffer.ByteBufcapacity(int paramInt) io.netty.buffer.ByteBufcopy(int index, int length) io.netty.buffer.ByteBufgetBytes(int index, byte[] dst, int dstIndex, int length) io.netty.buffer.ByteBufgetBytes(int index, io.netty.buffer.ByteBuf dst, int dstIndex, int length) io.netty.buffer.ByteBufgetBytes(int index, OutputStream dst, int length) io.netty.buffer.ByteBufgetBytes(int index, ByteBuffer dst) intgetBytes(int arg0, FileChannel arg1, long arg2, int arg3) intgetBytes(int index, GatheringByteChannel out, int length) booleanhasArray()booleaninternalNioBuffer(int paramInt1, int paramInt2) booleanisDirect()longnioBuffer(int paramInt1, int paramInt2) intnioBuffers(int paramInt1, int paramInt2) order()static io.netty.buffer.ByteBufpacketReader(DataInputStream input) Construct a new Minecraft packet serializer using the current byte buf adapter.static io.netty.buffer.ByteBufpacketWriter(DataOutputStream output) Construct a new Minecraft packet deserializer using the current byte buf adapter.intrefCnt()booleanrelease()booleanrelease(int paramInt) io.netty.buffer.ByteBufretain()io.netty.buffer.ByteBufretain(int paramInt) io.netty.buffer.ByteBufsetBytes(int index, byte[] src, int srcIndex, int length) io.netty.buffer.ByteBufsetBytes(int index, io.netty.buffer.ByteBuf src, int srcIndex, int length) intsetBytes(int index, InputStream in, int length) io.netty.buffer.ByteBufsetBytes(int index, ByteBuffer src) intsetBytes(int arg0, FileChannel arg1, long arg2, int arg3) intsetBytes(int index, ScatteringByteChannel in, int length) io.netty.buffer.ByteBuftouch()io.netty.buffer.ByteBufio.netty.buffer.ByteBufunwrap()Methods inherited from class io.netty.buffer.AbstractByteBuf
adjustMarkers, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkIndex, checkIndex, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getInt, getLong, getMedium, getShort, getUnsignedByte, getUnsignedInt, getUnsignedMedium, getUnsignedShort, hashCode, indexOf, isReadable, isReadable, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, resetReaderIndex, resetWriterIndex, setBoolean, setByte, setBytes, setBytes, setBytes, setChar, setDouble, setFloat, setIndex, setInt, setLong, setMedium, setShort, setZero, skipBytes, slice, slice, toString, toString, toString, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writerIndex, writerIndex, writeShort, writeZero
-
Method Details
-
packetReader
Construct a new Minecraft packet serializer using the current byte buf adapter.- Parameters:
input- - the input stream.- Returns:
- A packet serializer with a wrapped byte buf adapter.
-
packetWriter
Construct a new Minecraft packet deserializer using the current byte buf adapter.- Parameters:
output- - the output stream.- Returns:
- A packet serializer with a wrapped byte buf adapter.
-
refCnt
public int refCnt() -
release
public boolean release() -
release
public boolean release(int paramInt) -
_getByte
protected byte _getByte(int paramInt) - Specified by:
_getBytein classio.netty.buffer.AbstractByteBuf
-
_getShort
protected short _getShort(int paramInt) - Specified by:
_getShortin classio.netty.buffer.AbstractByteBuf
-
_getUnsignedMedium
protected int _getUnsignedMedium(int paramInt) - Specified by:
_getUnsignedMediumin classio.netty.buffer.AbstractByteBuf
-
_getInt
protected int _getInt(int paramInt) - Specified by:
_getIntin classio.netty.buffer.AbstractByteBuf
-
_getLong
protected long _getLong(int paramInt) - Specified by:
_getLongin classio.netty.buffer.AbstractByteBuf
-
_setByte
protected void _setByte(int index, int value) - Specified by:
_setBytein classio.netty.buffer.AbstractByteBuf
-
_setShort
protected void _setShort(int index, int value) - Specified by:
_setShortin classio.netty.buffer.AbstractByteBuf
-
_setMedium
protected void _setMedium(int index, int value) - Specified by:
_setMediumin classio.netty.buffer.AbstractByteBuf
-
_setInt
protected void _setInt(int index, int value) - Specified by:
_setIntin classio.netty.buffer.AbstractByteBuf
-
_setLong
protected void _setLong(int index, long value) - Specified by:
_setLongin classio.netty.buffer.AbstractByteBuf
-
capacity
public int capacity()- Specified by:
capacityin classio.netty.buffer.ByteBuf
-
capacity
public io.netty.buffer.ByteBuf capacity(int paramInt) - Specified by:
capacityin classio.netty.buffer.ByteBuf
-
alloc
public io.netty.buffer.ByteBufAllocator alloc()- Specified by:
allocin classio.netty.buffer.ByteBuf
-
order
- Specified by:
orderin classio.netty.buffer.ByteBuf
-
unwrap
public io.netty.buffer.ByteBuf unwrap()- Specified by:
unwrapin classio.netty.buffer.ByteBuf
-
isDirect
public boolean isDirect()- Specified by:
isDirectin classio.netty.buffer.ByteBuf
-
getBytes
public io.netty.buffer.ByteBuf getBytes(int index, io.netty.buffer.ByteBuf dst, int dstIndex, int length) - Specified by:
getBytesin classio.netty.buffer.ByteBuf
-
getBytes
public io.netty.buffer.ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length) - Specified by:
getBytesin classio.netty.buffer.ByteBuf
-
getBytes
- Specified by:
getBytesin classio.netty.buffer.ByteBuf
-
getBytes
- Specified by:
getBytesin classio.netty.buffer.ByteBuf- Throws:
IOException
-
getBytes
- Specified by:
getBytesin classio.netty.buffer.ByteBuf- Throws:
IOException
-
setBytes
public io.netty.buffer.ByteBuf setBytes(int index, io.netty.buffer.ByteBuf src, int srcIndex, int length) - Specified by:
setBytesin classio.netty.buffer.ByteBuf
-
setBytes
public io.netty.buffer.ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) - Specified by:
setBytesin classio.netty.buffer.ByteBuf
-
setBytes
- Specified by:
setBytesin classio.netty.buffer.ByteBuf
-
setBytes
- Specified by:
setBytesin classio.netty.buffer.ByteBuf- Throws:
IOException
-
setBytes
- Specified by:
setBytesin classio.netty.buffer.ByteBuf- Throws:
IOException
-
copy
public io.netty.buffer.ByteBuf copy(int index, int length) - Specified by:
copyin classio.netty.buffer.ByteBuf
-
nioBufferCount
public int nioBufferCount()- Specified by:
nioBufferCountin classio.netty.buffer.ByteBuf
-
nioBuffer
- Specified by:
nioBufferin classio.netty.buffer.ByteBuf
-
internalNioBuffer
- Specified by:
internalNioBufferin classio.netty.buffer.ByteBuf
-
nioBuffers
- Specified by:
nioBuffersin classio.netty.buffer.ByteBuf
-
hasArray
public boolean hasArray()- Specified by:
hasArrayin classio.netty.buffer.ByteBuf
-
array
public byte[] array()- Specified by:
arrayin classio.netty.buffer.ByteBuf
-
arrayOffset
public int arrayOffset()- Specified by:
arrayOffsetin classio.netty.buffer.ByteBuf
-
hasMemoryAddress
public boolean hasMemoryAddress()- Specified by:
hasMemoryAddressin classio.netty.buffer.ByteBuf
-
memoryAddress
public long memoryAddress()- Specified by:
memoryAddressin classio.netty.buffer.ByteBuf
-
retain
public io.netty.buffer.ByteBuf retain(int paramInt) - Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Specified by:
retainin classio.netty.buffer.ByteBuf
-
retain
public io.netty.buffer.ByteBuf retain()- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Specified by:
retainin classio.netty.buffer.ByteBuf
-
_getIntLE
protected int _getIntLE(int arg0) -
_getLongLE
protected long _getLongLE(int arg0) -
_getShortLE
protected short _getShortLE(int arg0) -
_getUnsignedMediumLE
protected int _getUnsignedMediumLE(int arg0) -
_setIntLE
protected void _setIntLE(int arg0, int arg1) -
_setLongLE
protected void _setLongLE(int arg0, long arg1) -
_setMediumLE
protected void _setMediumLE(int arg0, int arg1) -
_setShortLE
protected void _setShortLE(int arg0, int arg1) -
getBytes
- Throws:
IOException
-
setBytes
-
touch
public io.netty.buffer.ByteBuf touch() -
touch
-