|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.protocol.VNSProtocolCharCoder
public class VNSProtocolCharCoder
Transforms arbitrary strings into a buffer of bytes and vice versa using US ASCII encoding and decoding.
Field Summary | |
---|---|
static java.nio.charset.Charset |
charset
The US ASCII character set of the coder |
static java.nio.charset.CharsetDecoder |
decoder
Decoder of the US ASCII byte buffers |
static java.nio.charset.CharsetEncoder |
encoder
Encoder of the US ASCII strings |
Constructor Summary | |
---|---|
VNSProtocolCharCoder()
|
Method Summary | |
---|---|
static java.lang.String |
decode(java.nio.ByteBuffer byteBuffer)
Decodes the supplied byte buffer into a string using US ASCII decoding. |
static java.lang.String |
decode(java.nio.ByteBuffer byteBuffer,
boolean trim)
Decodes the supplied byte buffer into a string using US ASCII decoding. |
static java.lang.String |
decode(java.nio.ByteBuffer byteBuffer,
int length)
Decodes the supplied byte buffer into a string using US ASCII decoding. |
static java.nio.ByteBuffer |
encode(java.lang.String message)
Encodes the supplied message into a byte buffer using US ASCII encoding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.nio.charset.Charset charset
public static java.nio.charset.CharsetEncoder encoder
public static java.nio.charset.CharsetDecoder decoder
Constructor Detail |
---|
public VNSProtocolCharCoder()
Method Detail |
---|
public static java.nio.ByteBuffer encode(java.lang.String message) throws java.nio.charset.CharacterCodingException
message
- Message to be encoded
java.nio.charset.CharacterCodingException
public static java.lang.String decode(java.nio.ByteBuffer byteBuffer) throws java.nio.charset.CharacterCodingException
byteBuffer
- Byte buffer containing the encoded messasge
java.nio.charset.CharacterCodingException
public static java.lang.String decode(java.nio.ByteBuffer byteBuffer, int length) throws java.nio.charset.CharacterCodingException
byteBuffer
- Byte buffer containing the encoded messasgelength
- Length of the returned message
java.nio.charset.CharacterCodingException
public static java.lang.String decode(java.nio.ByteBuffer byteBuffer, boolean trim) throws java.nio.charset.CharacterCodingException
byteBuffer
- Byte buffer containing the encoded messasgetrim
- If true, the message will be trimmed from the right
java.nio.charset.CharacterCodingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |