com.cafesoft.core.util
Class ByteUtils

java.lang.Object
  |
  +--com.cafesoft.core.util.ByteUtils

public class ByteUtils
extends Object

ByteUtils provides convenience methods for byte manipulations.


Constructor Summary
ByteUtils()
           
 
Method Summary
static byte[] concatenate(byte[] l, byte[] r)
          Return a byte array concatenated from two byte arrays.
static byte[][] split(byte[] src, int n)
          Return a two dimensional byte array from a single byte array.
static String toHex(byte[] block)
          Return hex values from a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteUtils

public ByteUtils()
Method Detail

concatenate

public static byte[] concatenate(byte[] l,
                                 byte[] r)
Return a byte array concatenated from two byte arrays.

Parameters:
l - the left side of the new byte array.
r - the right side of the new byte array.
Returns:
the concatenated byte array.

split

public static byte[][] split(byte[] src,
                             int n)
Return a two dimensional byte array from a single byte array.

Parameters:
src - the byte array that will be split.
n - the index where the input array will be split.
Returns:
the split byte arrays.

toHex

public static String toHex(byte[] block)
Return hex values from a string.

Parameters:
block - the byte array to convert to hex.
Returns:
the hex string.


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.