question: public static byte [ ] packByteBufferIntoSingleByteArray ( ByteBuffer [ ] byteBufferArr ) { 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 ) ; buffer . putShort ( ( short ) ( totalBytes - toDetermineLengthOfByteArr ) ) ; buffer . putShort ( offsetLen ) ; for ( int index = 0 ; index < byteBufferArr . length - 1 ; index ++ ) { ByteBuffer individualCol = byteBufferArr [ index ] ; int noOfBytes = individualCol . capacity ( ) ; buffer . putShort ( ( short ) ( offsetLen + noOfBytes ) ) ; offsetLen += noOfBytes ; individualCol . rewind ( ) ; } for ( int index = 0 ; index < byteBufferArr . length ; index ++ ) { ByteBuffer individualCol = byteBufferArr [ index ] ; buffer . put ( individualCol . array ( ) ) ; } buffer . rewind ( ) ; return buffer . array ( ) ; }
target:  This method will form one single byte [] for all the high card dims.