Java Utililty Methods ByteBuffer Merge

List of utility methods to do ByteBuffer Merge

Description

The list of methods to do ByteBuffer Merge are organized into topic(s).

Method

byte[]packByteBufferIntoSingleByteArray(ByteBuffer[] byteBufferArr)
This method will form one single byte [] for all the high card dims.
if (null == byteBufferArr || byteBufferArr.length == 0) {
    return null;
int noOfCol = byteBufferArr.length;
short offsetLen = (short) (noOfCol * 2);
int totalBytes = calculateTotalBytes(byteBufferArr) + offsetLen;
ByteBuffer buffer = ByteBuffer.allocate(totalBytes);
buffer.putShort(offsetLen);
...
byte[]packByteBufferIntoSingleByteArray(ByteBuffer[] byteBufferArr)
This method will form one single byte [] for all the high card dims.
if (null == byteBufferArr || byteBufferArr.length == 0) {
    return null;
int noOfCol = byteBufferArr.length;
short toDetermineLengthOfByteArr = 2;
short offsetLen = (short) (noOfCol * 2 + toDetermineLengthOfByteArr);
int totalBytes = calculateTotalBytes(byteBufferArr) + offsetLen;
ByteBuffer buffer = ByteBuffer.allocate(totalBytes);
...