de.sagd.u4etx.cis.utils
Class Utils

java.lang.Object
  |
  +--de.sagd.u4etx.cis.utils.Utils

public class Utils
extends java.lang.Object

Some utils usefor when working with byte arrays.


Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String bytesAsString(byte[] abBytes)
          Returns a human readable represantation of the given byte array.
static void copy(byte[] dest, int off, byte[] src)
          Copies bytes from src into dest, starting at off and ending at off + len.
static byte[] getSubArray(byte[] src, int off, int len)
          Returns a sub-array of src, starting at off and ending at off + len.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getSubArray

public static byte[] getSubArray(byte[] src,
                                 int off,
                                 int len)
Returns a sub-array of src, starting at off and ending at off + len.
Parameters:
src - The source array to extract the sub-array from.
off - The offset to start copying.
len - The length tp copy.
Returns:
The extracted sub-array.

copy

public static void copy(byte[] dest,
                        int off,
                        byte[] src)
Copies bytes from src into dest, starting at off and ending at off + len.
Parameters:
dest - The array to copy the bytes to.
off - The offset to start copying.
src - The destination array to copy to.

bytesAsString

public static java.lang.String bytesAsString(byte[] abBytes)
Returns a human readable represantation of the given byte array. The bytes will not be converted but only the digits will be returned as string.
Parameters:
abBytes - The bytes to return as string.
Returns:
A string representation of the giben bytes.