Examples of BigFileByteBuffer


Examples of ar.util.memoryMapping.BigFileByteBuffer

  }


  @Test
  public void minMax() throws Exception {
    BigFileByteBuffer buffer = new BigFileByteBuffer(new File(hbinName), 1000);
    MemMapEncoder.Header header = MemMapEncoder.Header.from(buffer);
   
    IndexedEncoding maxEntry = new IndexedEncoding(header.types, header.maximaRecordOffset, buffer);
    IndexedEncoding minEntry = new IndexedEncoding(header.types, header.minimaRecordOffset, buffer);
   
    double max = Double.MIN_VALUE, min=Double.MAX_VALUE;
   
    long cursor = header.dataTableOffset;
    while(cursor < buffer.fileSize()) {
      IndexedEncoding entry = new IndexedEncoding(header.types, cursor, buffer);
      cursor += header.recordLength;
      max = Math.max(max, (Double) entry.get(0));
      min = Math.min(min, (Double) entry.get(0));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.