public class LengthDecoder
extends java.lang.Object
Constructor and Description |
---|
LengthDecoder() |
Modifier and Type | Method and Description |
---|---|
long |
decode(byte[] rawBytes)
Reads length from byte array.
|
long |
decode(java.nio.ByteBuffer byteBuffer)
Reads length from byte array.
|
byte |
getLengthLength(byte[] rawBytes)
Returns the number of bytes that denote the length value
|
public long decode(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
byteBuffer
- byte arrayjava.io.IOException
- invalid buffer lengthpublic long decode(byte[] rawBytes) throws java.io.IOException
rawBytes
- byte arrayjava.io.IOException
- invalid array lengthpublic byte getLengthLength(byte[] rawBytes)
rawBytes
- bytes to read