org.PingOO.DLAI.lib.util
Class BinaryCodec

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.util.BinaryCodec

public final class BinaryCodec
extends java.lang.Object

Provides a translator to byte array.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)

Constructor Summary
private BinaryCodec()
          Hides the constructor from the outside.
 
Method Summary
static byte[] encode(char[] data)
          Translates a char array into a byte array.
static byte[] encode(java.lang.String data)
          Translates a string into a byte array.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

BinaryCodec

private BinaryCodec()
Hides the constructor from the outside.
Method Detail

encode

public static byte[] encode(java.lang.String data)
                     throws java.lang.NullPointerException
Translates a string into a byte array.
Still does not know if this is really platteform independant but it was really missed.
Parameters:
data - The data to put in byte array.
Returns:
A byte array.
Throws:
java.lang.NullPointerException - If data is null.

encode

public static byte[] encode(char[] data)
                     throws java.lang.NullPointerException
Translates a char array into a byte array.
Still does not know if this is really platteform independant but it was really missed.
Parameters:
data - The data to put in byte array.
Returns:
A byte array.
Throws:
java.lang.NullPointerException - If data is null.