Package java.nio

Examples of java.nio.MappedByteBuffer.load()


      long overlapStartByte = runningNumBytesRead + thisByteOffset;
      byte[] overlapBytes = new byte[filterLength];
      try {
        MappedByteBuffer overlapBuffer = fileChannel.map(
                 MapMode.READ_ONLY, overlapStartByte, filterLength);
        overlapBuffer.load();
        overlapBuffer.get(overlapBytes, 0, filterLength);
      } catch (Exception e) {
        WError.showError( "Unable to read file " + featuresFile + ".",
                          "BEViewer file read error", e);
        throw new RuntimeException("File error");
View Full Code Here


      in.readFully(me);
      Number160 hash = new Number160(me);
      RandomAccessFile file = new RandomAccessFile(new File(path, hash.toString()), "r");
      FileChannel inChannel = file.getChannel();
      MappedByteBuffer buffer = inChannel.map(FileChannel.MapMode.READ_ONLY, 0, inChannel.size());
      buffer.load();
      ByteBuf buf = Unpooled.wrappedBuffer(buffer);
      Data data = Data.decodeHeader(buf, signatureFactory);
      data.decodeBuffer(buf);
      data.decodeDone(buf, signatureFactory);
      file.close();
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.