|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectie.omk.smpp.message.tlv.NullEncoder
public class NullEncoder
"No value" encoder. This encoder type was necessary as there are some
optional parameters that have no value. Therefore, it was possible for the
tag/value map in TLVTable
to have null
values
in it. As null
is also returned from a map when there is no
value for a particular key, some way was needed to distinguish between a
parameter not set and a parameter having a null value. Hence the encoder.
Constructor Summary | |
---|---|
NullEncoder()
Create a new NullEncoder. |
Method Summary | |
---|---|
int |
getValueLength(Tag tag,
Object value)
Calculate the length, in bytes, that the value will encode as. |
Object |
readFrom(Tag tag,
byte[] b,
int offset,
int length)
Decode a value from a byte array. |
void |
writeTo(Tag tag,
Object value,
byte[] b,
int offset)
Encode a value to a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullEncoder()
Method Detail |
---|
public void writeTo(Tag tag, Object value, byte[] b, int offset)
Encoder
writeTo
in interface Encoder
tag
- The tag of the value to encode.value
- The value to encode.b
- The byte array to encode the value to.offset
- The offset within b
to begin encoding from.public Object readFrom(Tag tag, byte[] b, int offset, int length)
Encoder
readFrom
in interface Encoder
tag
- The tag of the value to decode.b
- The byte array to decode the value from.offset
- The offset in b
to begin decoding from.length
- The length of the value to decode.
public int getValueLength(Tag tag, Object value)
Encoder
writeTo
will attempt to encode to a byte array.
getValueLength
in interface Encoder
tag
- The tag of the value to get the length for.value
- The value to get the length for.
value
will encode to in bytes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |