|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dicom4j.core.utils.ByteArray
public class ByteArray
Various static methods helpful for manipulating arrays of bytes and extracting values from them.
| Method Summary | |
|---|---|
static int |
bigEndianToUnsignedInt(byte[] b)
Extract an unsigned big endian integer from an entire byte array. |
static int |
bigEndianToUnsignedInt(byte[] b,
int offset,
int length)
Extract an unsigned big endian integer from a byte array. |
static byte[] |
concatenate(byte[] src1,
byte[] src2)
Concatenate the entire contents of two byte arrays into a new byte array. |
static byte[] |
concatenate(byte[] src1,
int offset1,
int length1,
byte[] src2,
int offset2,
int length2)
Concatenate portions of two byte arrays into a new byte array. |
static byte[] |
extractBytes(byte[] src,
int offset,
int length)
Extract a portion of a byte array into a new byte array. |
static void |
main(String[] arg)
Testing. |
static void |
swapEndianness(byte[] src,
int byteCount,
int wordLength)
Swap the byte order (endianness) of fixed length words within a byte array. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final int bigEndianToUnsignedInt(byte[] b)
Extract an unsigned big endian integer from an entire byte array.
b - the byte array which is the big endian encoded integer
public static final int bigEndianToUnsignedInt(byte[] b,
int offset,
int length)
Extract an unsigned big endian integer from a byte array.
b - the byte array containing the big endian encoded integeroffset - the offset of the start of the integer in the byte arraylength - the number of bytes that the integer occupies in the byte array
public static final byte[] concatenate(byte[] src1,
byte[] src2)
Concatenate the entire contents of two byte arrays into a new byte array.
src1 - the first byte arraysrc2 - the second byte array
public static final byte[] concatenate(byte[] src1,
int offset1,
int length1,
byte[] src2,
int offset2,
int length2)
Concatenate portions of two byte arrays into a new byte array.
src1 - the first byte arrayoffset1 - the offset of the bytes to be extracted from the first byte arraylength1 - the number of bytes to be extracted from the first byte arraysrc2 - the second byte arrayoffset2 - the offset of the bytes to be extracted from the second byte arraylength2 - the number of bytes to be extracted from the second byte array
public static final byte[] extractBytes(byte[] src,
int offset,
int length)
Extract a portion of a byte array into a new byte array.
src - the source byte arrayoffset - the offset of the bytes to be extractedlength - the number of bytes to be extracted
public static void main(String[] arg)
Testing.
arg - ignored
public static final void swapEndianness(byte[] src,
int byteCount,
int wordLength)
Swap the byte order (endianness) of fixed length words within a byte array.
src - the byte array (swapped in place)byteCount - the number of bytes in the array to swapwordLength - the length in bytes of each word
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||