ahc.util.bytes
Class StringEndEncoding

java.lang.Object
  |
  +--ahc.util.bytes.StringEndEncoding

public abstract class StringEndEncoding
extends java.lang.Object

This class represents ways to encode the length of a string. Three standard implementations are provided as public static final references.

Author:
Arno Haase

Field Summary
static StringEndEncoding END_LEN_PREFIX_16_HILO
          The length of the string (in bytes) is encoded as a prefixed 16-bit value in hi-lo.
static StringEndEncoding END_NONE
          The length of the string is not encoded at all.
static StringEndEncoding END_NULL
          The length of the string is encoded as a trailing zero byte.
 
Constructor Summary
StringEndEncoding()
           
 
Method Summary
abstract  byte[] addLenEncoding(byte[] raw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

END_NONE

public static final StringEndEncoding END_NONE
The length of the string is not encoded at all.


END_NULL

public static final StringEndEncoding END_NULL
The length of the string is encoded as a trailing zero byte.


END_LEN_PREFIX_16_HILO

public static final StringEndEncoding END_LEN_PREFIX_16_HILO
The length of the string (in bytes) is encoded as a prefixed 16-bit value in hi-lo.

Constructor Detail

StringEndEncoding

public StringEndEncoding()
Method Detail

addLenEncoding

public abstract byte[] addLenEncoding(byte[] raw)