public void writeDataToFile(byte[] keyArray,byte[][] dataArray,int entryCount,byte[] startKey,byte[] endKey) throws CarbonDataWriterException {
  if (this.isNewFileCreationRequired) {
    updateBlockletFileChannel();
  }
  int totalMsrArraySize=0;
  int currentMsrLenght=0;
  int[] msrLength=new int[this.measureCount];
  for (int i=0; i < dataArray.length; i++) {
    currentMsrLenght=dataArray[i].length;
    totalMsrArraySize+=currentMsrLenght;
    msrLength[i]=currentMsrLenght;
  }
  byte[] writableDataArray=new byte[totalMsrArraySize];
  int startPosition=0;
  for (int i=0; i < dataArray.length; i++) {
    System.arraycopy(dataArray[i],0,writableDataArray,startPosition,dataArray[i].length);
    startPosition+=msrLength[i];
  }
  writeDataToFile(keyArray,writableDataArray,msrLength,entryCount,startKey,endKey);
}

public void writeDataToFile ( byte [ ] keyArray , byte [ ] [ ] dataArray , int entryCount , byte [ ] startKey , byte [ ] endKey ) throws CarbonDataWriterException { if ( this . isNewFileCreationRequired ) { updateBlockletFileChannel ( ) ; } int totalMsrArraySize = 0 ; int currentMsrLenght = 0 ; int [ ] msrLength = new int [ this . measureCount ] ; for ( int i = 0 ; i < dataArray . length ; i ++ ) { currentMsrLenght = dataArray [ i ] . length ; totalMsrArraySize += currentMsrLenght ; msrLength [ i ] = currentMsrLenght ; } byte [ ] writableDataArray = new byte [ totalMsrArraySize ] ; int startPosition = 0 ; for ( int i = 0 ; i < dataArray . length ; i ++ ) { System . arraycopy ( dataArray [ i ] , 0 , writableDataArray , startPosition , dataArray [ i ] . length ) ; startPosition += msrLength [ i ] ; } writeDataToFile ( keyArray , writableDataArray , msrLength , entryCount , startKey , endKey ) ; }
this method will be used to write leaf data to file file format < key > < measure1 > < measure2 > . . . .
