| 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
EncoderencodeBoolean in interface Encoderbool - the value to encodeException - if an error occurs during encodingpublic void encodeByte(byte b)
throws Exception
EncoderencodeByte in interface Encoderb - the value to encodeException - if an error occurs during encodingpublic void encodeSignedShort(short s)
throws Exception
EncoderencodeSignedShort in interface Encoders - the value to encodeException - if an error occurs during encodingpublic void encodeUnsignedShort(short s)
throws Exception
EncoderencodeUnsignedShort in interface Encoders - the value to encodeException - if an error occurs during encodingpublic void encode16(short s)
throws Exception
Encoderpublic void encodeSignedInt(int i)
throws Exception
EncoderencodeSignedInt in interface Encoderi - the value to encodeException - if an error occurs during encodingpublic void encodeUnsignedInt(int i)
throws Exception
EncoderencodeUnsignedInt in interface Encoderi - the value to encodeException - if an error occurs during encodingpublic void encode32(int i)
throws Exception
Encoderpublic void encodeSignedLong(long l)
throws Exception
EncoderencodeSignedLong in interface Encoderl - the value to encodeException - if an error occurs during encodingpublic void encodeUnsignedLong(long l)
throws Exception
EncoderencodeUnsignedLong in interface Encoderl - the value to encodeException - if an error occurs during encodingpublic void encode64(long l)
throws Exception
Encoderpublic void encodeNullableString(String str) throws Exception
EncoderencodeNullableString in interface Encoderstr - the value to encodeException - if an error occurs during encodingpublic void encodeString(String str) throws Exception
EncoderencodeString in interface Encoderstr - the value to encodeException - if an error occurs during encodingpublic void encodeNullableByteArray(byte[] tab)
throws Exception
EncoderencodeNullableByteArray in interface Encodertab - the value to encodeException - if an error occurs during encodingpublic void encodeByteArray(byte[] tab)
throws Exception
EncoderencodeByteArray in interface Encodertab - the value to encodeException - if an error occurs during encodingpublic void encodeNullableByteArray(byte[] tab,
int offset,
int length)
throws Exception
EncoderencodeNullableByteArray in interface Encodertab - 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
EncoderencodeByteArray in interface Encodertab - 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
EncoderencodeFloat in interface Encoderf - the value to encodeException - if an error occurs during encodingpublic void encodeDouble(double d)
throws Exception
EncoderencodeDouble in interface Encoderd - the value to encodeException - if an error occurs during encodingCopyright © 2022 ScalAgent D.T.. All rights reserved.