public static byte[][] splitNoDictionaryKey(byte[] NoDictionaryArr,int NoDictionaryCount){
  byte[][] split=new byte[NoDictionaryCount][];
  ByteBuffer buff=ByteBuffer.wrap(NoDictionaryArr,2,NoDictionaryCount * 2);
  int remainingCol=NoDictionaryCount;
  short secIndex=0;
  short firstIndex=0;
  for (int i=0; i < NoDictionaryCount; i++) {
    if (remainingCol == 1) {
      firstIndex=buff.getShort();
      int length=NoDictionaryArr.length - firstIndex;
      split[i]=new byte[length + 2];
      ByteBuffer splittedCol=ByteBuffer.wrap(split[i]);
      splittedCol.putShort((short)length);
      System.arraycopy(NoDictionaryArr,firstIndex,split[i],2,length);
    }
 else {
      firstIndex=buff.getShort();
      secIndex=buff.getShort();
      int length=secIndex - firstIndex;
      split[i]=new byte[length + 2];
      ByteBuffer splittedCol=ByteBuffer.wrap(split[i]);
      splittedCol.putShort((short)length);
      System.arraycopy(NoDictionaryArr,firstIndex,split[i],2,length);
      buff.position(buff.position() - 2);
    }
    remainingCol--;
  }
  return split;
}

public static byte [ ] [ ] splitNoDictionaryKey ( byte [ ] NoDictionaryArr , int NoDictionaryCount ) { byte [ ] [ ] split = new byte [ NoDictionaryCount ] [ ] ; ByteBuffer buff = ByteBuffer . wrap ( NoDictionaryArr , 2 , NoDictionaryCount * 2 ) ; int remainingCol = NoDictionaryCount ; short secIndex = 0 ; short firstIndex = 0 ; for ( int i = 0 ; i < NoDictionaryCount ; i ++ ) { if ( remainingCol == 1 ) { firstIndex = buff . getShort ( ) ; int length = NoDictionaryArr . length - firstIndex ; split [ i ] = new byte [ length + 2 ] ; ByteBuffer splittedCol = ByteBuffer . wrap ( split [ i ] ) ; splittedCol . putShort ( ( short ) length ) ; System . arraycopy ( NoDictionaryArr , firstIndex , split [ i ] , 2 , length ) ; } else { firstIndex = buff . getShort ( ) ; secIndex = buff . getShort ( ) ; int length = secIndex - firstIndex ; split [ i ] = new byte [ length + 2 ] ; ByteBuffer splittedCol = ByteBuffer . wrap ( split [ i ] ) ; splittedCol . putShort ( ( short ) length ) ; System . arraycopy ( NoDictionaryArr , firstIndex , split [ i ] , 2 , length ) ; buff . position ( buff . position ( ) - 2 ) ; } remainingCol -- ; } return split ; }
this method will split one single byte array of high card dims into array of byte arrays .
