Package java.io

Examples of java.io.DataInputStream.readLong()


      actualPointers.add(ptr.toLong());
    }
    Assert.assertEquals(expectedPointers, actualPointers);
    Assert.assertEquals(10, backingStore.getCapacity());
    DataInputStream in = new DataInputStream(new FileInputStream(checkpoint));
    long actualVersion = in.readLong();
    Assert.assertEquals(expectedVersion, actualVersion);
    in.close();
  }
}
View Full Code Here


             *   u1 tag;
             *   u4 high_bytes;
             *   u4 low_bytes;
             * }
             */
            in.readLong();

            /*
             * We must increase the constant pool index because this tag
             * type takes two entries
             */
 
View Full Code Here

            System.out.println("Read old-format master keys file. Writing new format master.keys ...");
                    ret.changePassword(masterKeysFile, password, hardRandom);
                    return ret;
        }
        if(dis.readInt() != VERSION) throw new IOException("Bad version for master.keys");
        long iterations = dis.readLong();
        if(iterations < 0 || iterations > MAX_ITERATIONS) throw new IOException("Bad iterations "+iterations+" for master.keys");
       
        byte[] salt = new byte[32];
        dis.readFully(salt);
        byte[] iv = new byte[32];
View Full Code Here

        }

        // It matches. Now decode it.
        ByteArrayInputStream bais = new ByteArrayInputStream(data);
        dis = new DataInputStream(bais);
        long flags = dis.readLong();
        // At the moment there are no interesting flags.
        // In future the flags will tell us whether the database and the datastore are encrypted.
        byte[] clientCacheKey = new byte[32];
        dis.readFully(clientCacheKey);
        byte[] databaseKey = null;
View Full Code Here

      buf = ByteBuffer.allocate(size);
      if (crc != null) {
        crc.reset();
        CheckedInputStream chk = new CheckedInputStream(in, crc);
        IOUtils.readFully(chk, buf.array(), 0, size);
        if (chk.getChecksum().getValue() != in.readLong()) {
          throw new ChecksumException("Checksum error reading spill index: " +
                                indexFileName, -1);
        }
      } else {
        IOUtils.readFully(in, buf.array(), 0, size);
View Full Code Here

          fsDir.unprotectedMkdir(path, permissions, timestamp);
          break;
        }
        case OP_SET_GENSTAMP: {
          numOpSetGenStamp++;
          long lw = in.readLong();
          fsDir.namesystem.setGenerationStamp(lw);
          break;
        }
        case OP_DATANODE_ADD: {
          numOpOther++;
View Full Code Here

    File timeFile = getImageFile(sd, NameNodeFile.TIME);
    long timeStamp = 0L;
    if (timeFile.exists() && timeFile.canRead()) {
      DataInputStream in = new DataInputStream(new FileInputStream(timeFile));
      try {
        timeStamp = in.readLong();
      } finally {
        in.close();
      }
    }
    return timeStamp;
View Full Code Here

      this.namespaceID = in.readInt();

      // read number of files
      long numFiles;
      if (imgVersion <= -16) {
        numFiles = in.readLong();
      } else {
        numFiles = in.readInt();
      }

      this.layoutVersion = imgVersion;
View Full Code Here

      }

      this.layoutVersion = imgVersion;
      // read in the last generation stamp.
      if (imgVersion <= -12) {
        long genstamp = in.readLong();
        fsNamesys.setGenerationStamp(genstamp);
      }

      needToSave = (imgVersion != FSConstants.LAYOUT_VERSION);
View Full Code Here

        long atime = 0;
        long blockSize = 0;
        path = readString(in);
        replication = in.readShort();
        replication = FSEditLog.adjustReplication(replication);
        modificationTime = in.readLong();
        if (imgVersion <= -17) {
          atime = in.readLong();
        }
        if (imgVersion <= -8) {
          blockSize = in.readLong();
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.