public final class ByteHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
bitSetToBytes(java.util.BitSet bs)
Copy a BitSet to a byte array
|
static java.util.BitSet |
copyBits(java.util.BitSet source,
java.util.BitSet dest,
int fromIndex)
Copy bits completely from a source BitSet to
a destination BitSet starting at the destination
index
|
static byte[] |
copyBytes(byte[] from,
byte[] to,
int fromIndex)
Copy bytes completely from a source byte array to
a destination byte array starting at the destination
index
|
static byte |
getChecksum(byte[] result)
Implementation of an XOR checksum
|
static void |
put(java.nio.ByteBuffer bb,
byte[] bytes,
int from)
The missing method on a ByteBuffer - allows copying
of multiple bytes into the buffer.
|
static java.util.BitSet |
reverseBitSet(java.util.BitSet bs)
Noddy method to reverse a BitSet.
|
public static java.util.BitSet reverseBitSet(java.util.BitSet bs)
bs - public static byte[] bitSetToBytes(java.util.BitSet bs)
bs - public static java.util.BitSet copyBits(java.util.BitSet source,
java.util.BitSet dest,
int fromIndex)
source - dest - fromIndex - public static byte[] copyBytes(byte[] from,
byte[] to,
int fromIndex)
from - to - fromIndex - public static void put(java.nio.ByteBuffer bb,
byte[] bytes,
int from)
bb - bytes - from - public static byte getChecksum(byte[] result)
result -