net.sf.xbus.base.core.bytearrays
Class XByteArraySupport

java.lang.Object
  extended by net.sf.xbus.base.core.bytearrays.XByteArraySupport

public class XByteArraySupport
extends java.lang.Object

XByteArraySupport gives some support in manipulating byte arrays.

Author:
Stephan Düwel

Constructor Summary
XByteArraySupport()
           
 
Method Summary
static byte[] subArray(byte[] array, int pos, int length)
          subArray extracts a byte array from another.
static byte[] transformToByteArray(java.lang.Object inObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XByteArraySupport

public XByteArraySupport()
Method Detail

subArray

public static byte[] subArray(byte[] array,
                              int pos,
                              int length)
                       throws XException
subArray extracts a byte array from another.

Parameters:
array - the complete byte array
pos - the starting position for extracting
length - the length of extracted sub-array
Returns:
the extracted sub-array
Throws:
XException - in case of unpossible pos or length values

transformToByteArray

public static byte[] transformToByteArray(java.lang.Object inObject)
                                   throws XException
Parameters:
inObject - must be an InputStream
Returns:
the content of the InputStread as a byte array
Throws:
XException