public static byte[] readUploadData(final UploadStorageType storageType,final byte[] body,final RandomAccessFile uploadFile,final int uploadTempFileSize,final int chunkSize) throws IOException {
  byte[] data;
  if (storageType == UploadStorageType.RAM_STORAGE) {
    data=Arrays.copyOfRange(body,uploadTempFileSize,uploadTempFileSize + chunkSize);
  }
 else {
    data=new byte[chunkSize];
    uploadFile.seek(uploadTempFileSize);
    uploadFile.read(data);
  }
  return data;
}

public static byte [ ] readUploadData ( final UploadStorageType storageType , final byte [ ] body , final RandomAccessFile uploadFile , final int uploadTempFileSize , final int chunkSize ) throws IOException { byte [ ] data ; if ( storageType == UploadStorageType . RAM_STORAGE ) { data = Arrays . copyOfRange ( body , uploadTempFileSize , uploadTempFileSize + chunkSize ) ; } else { data = new byte [ chunkSize ] ; uploadFile . seek ( uploadTempFileSize ) ; uploadFile . read ( data ) ; } return data ; }
read data from ram of file storage for upload task .
