Modifier and Type | Field and Description |
---|---|
private ByteBuffer |
buf |
Constructor and Description |
---|
ByteBufferEncoder(ByteBuffer buf) |
Modifier and Type | Method and Description |
---|---|
void |
encode16(short s)
Encodes a signed short integer.
|
void |
encode32(int i)
Encodes a signed integer.
|
void |
encode64(long l)
Encodes a signed long integer.
|
void |
encodeBoolean(boolean bool)
Encodes a boolean.
|
void |
encodeByte(byte b)
Encodes a byte.
|
void |
encodeByteArray(byte[] tab)
Encodes a byte array that cannot be null.
|
void |
encodeByteArray(byte[] tab,
int offset,
int length)
Encodes a byte array that cannot be null.
|
void |
encodeDouble(double d)
Encodes a double.
|
void |
encodeFloat(float f)
Encodes a float.
|
void |
encodeNullableByteArray(byte[] tab)
Encodes a byte array that can be null.
|
void |
encodeNullableByteArray(byte[] tab,
int offset,
int length)
Encodes a byte array that can be null.
|
void |
encodeNullableString(String str)
Encodes a string that can be null.
|
private void |
encodeNullFlag(Object o) |
void |
encodeSignedInt(int i)
Encodes a signed integer.
|
void |
encodeSignedLong(long l)
Encodes a signed long integer.
|
void |
encodeSignedShort(short s)
Encodes a signed short integer.
|
void |
encodeString(String str)
Encodes a string that cannot be null.
|
void |
encodeUnsignedInt(int i)
Encodes an unsigned integer.
|
void |
encodeUnsignedLong(long l)
Encodes an unsigned long integer.
|
void |
encodeUnsignedShort(short s)
Encodes an unsigned short integer.
|
private ByteBuffer buf
public ByteBufferEncoder(ByteBuffer buf)
public void encodeBoolean(boolean bool) throws Exception
Encoder
encodeBoolean
in interface Encoder
bool
- the value to encodeException
- if an error occurs during encodingpublic void encodeByte(byte b) throws Exception
Encoder
encodeByte
in interface Encoder
b
- the value to encodeException
- if an error occurs during encodingpublic void encodeSignedShort(short s) throws Exception
Encoder
encodeSignedShort
in interface Encoder
s
- the value to encodeException
- if an error occurs during encodingpublic void encodeUnsignedShort(short s) throws Exception
Encoder
encodeUnsignedShort
in interface Encoder
s
- the value to encodeException
- if an error occurs during encodingpublic void encode16(short s) throws Exception
Encoder
public void encodeSignedInt(int i) throws Exception
Encoder
encodeSignedInt
in interface Encoder
i
- the value to encodeException
- if an error occurs during encodingpublic void encodeUnsignedInt(int i) throws Exception
Encoder
encodeUnsignedInt
in interface Encoder
i
- the value to encodeException
- if an error occurs during encodingpublic void encode32(int i) throws Exception
Encoder
public void encodeSignedLong(long l) throws Exception
Encoder
encodeSignedLong
in interface Encoder
l
- the value to encodeException
- if an error occurs during encodingpublic void encodeUnsignedLong(long l) throws Exception
Encoder
encodeUnsignedLong
in interface Encoder
l
- the value to encodeException
- if an error occurs during encodingpublic void encode64(long l) throws Exception
Encoder
public void encodeNullableString(String str) throws Exception
Encoder
encodeNullableString
in interface Encoder
str
- the value to encodeException
- if an error occurs during encodingpublic void encodeString(String str) throws Exception
Encoder
encodeString
in interface Encoder
str
- the value to encodeException
- if an error occurs during encodingpublic void encodeNullableByteArray(byte[] tab) throws Exception
Encoder
encodeNullableByteArray
in interface Encoder
tab
- the value to encodeException
- if an error occurs during encodingpublic void encodeByteArray(byte[] tab) throws Exception
Encoder
encodeByteArray
in interface Encoder
tab
- the value to encodeException
- if an error occurs during encodingpublic void encodeNullableByteArray(byte[] tab, int offset, int length) throws Exception
Encoder
encodeNullableByteArray
in interface Encoder
tab
- the value to encodeoffset
- the starting index in array blength
- the number of bytes to be encodedException
- if an error occurs during encodingpublic void encodeByteArray(byte[] tab, int offset, int length) throws Exception
Encoder
encodeByteArray
in interface Encoder
tab
- the value to encodeoffset
- the starting index in array blength
- the number of bytes to be encodedException
- if an error occurs during encodingpublic void encodeFloat(float f) throws Exception
Encoder
encodeFloat
in interface Encoder
f
- the value to encodeException
- if an error occurs during encodingpublic void encodeDouble(double d) throws Exception
Encoder
encodeDouble
in interface Encoder
d
- the value to encodeException
- if an error occurs during encodingCopyright © 2013 ScalAgent D.T.. All Rights Reserved.