SunSPOT API V3.0


com.sun.squawk.security
Class HexEncoding

java.lang.Object
  extended by com.sun.squawk.security.HexEncoding

public class HexEncoding
extends Object

Encode / Decode hexadecimal strings to / from byte arrays

Author:
msbrimne

Method Summary
static byte[] hexDecode(String str)
          Decode a string containing hexadecimal characters into a byte array.
static String hexEncode(byte[] b)
          Create a string containing the all of the data in the byte array b, encoded as hexadecimal characters.
static String hexEncode(byte[] b, int len)
          Create a string containing the data in the byte array b, encoded as hexadecimal characters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hexDecode

public static byte[] hexDecode(String str)
Decode a string containing hexadecimal characters into a byte array.

Parameters:
str - the string containing hexadecimal characters
Returns:
a new array containing the decoded data.

hexEncode

public static String hexEncode(byte[] b)
Create a string containing the all of the data in the byte array b, encoded as hexadecimal characters.

Parameters:
b - the data to encode
Returns:
the new string

hexEncode

public static String hexEncode(byte[] b,
                               int len)
Create a string containing the data in the byte array b, encoded as hexadecimal characters.

Parameters:
b - the data to encode
len - encode bytes 0 to len-1
Returns:
the new string

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.