public abstract class NetStreamUnpacker
extends java.lang.Object
Constructor and Description |
---|
NetStreamUnpacker() |
Modifier and Type | Method and Description |
---|---|
abstract int |
sizeOfInt()
An unpacker has to be abble to indicated what is the size of an int after being packed.
|
java.nio.ByteBuffer |
unpackMessage(java.nio.ByteBuffer buffer)
Unpack the given ByteBuffer
|
abstract java.nio.ByteBuffer |
unpackMessage(java.nio.ByteBuffer buffer,
int startIndex,
int endIndex)
Unpack the given ByteBuffer from startIndex to endIdex
|
abstract int |
unpackMessageSize(java.nio.ByteBuffer buffer)
Unpacks the data necessary to decode a 4 bytes integer that indicates the size of the following message.
|
public abstract int sizeOfInt()
public abstract java.nio.ByteBuffer unpackMessage(java.nio.ByteBuffer buffer, int startIndex, int endIndex)
buffer
- The buffer to unpack/decodestartIndex
- the index at which the decoding starts in the bufferendIndex
- the index at which the decoding stopspublic java.nio.ByteBuffer unpackMessage(java.nio.ByteBuffer buffer)
buffer
- The buffer to unpack/decodepublic abstract int unpackMessageSize(java.nio.ByteBuffer buffer)
buffer
- The byteBuffer who's content has the encoded value of the needed size integer.