Examples of DataInput


Examples of java.io.DataInput

      return dis.available() > 0;
    }
   
    public void readNext() throws IOException, DataFormatException {
      entryIndex++;
      DataInput di = dis;
      long l = di.readLong();
      offset = entryIndex == 0 ? 0 : (l >>> 16);
      flags = (int) (l & 0x0FFFF);
      compressedLen = di.readInt();
      actualLen = di.readInt();
      baseRevision = di.readInt();
      linkRevision = di.readInt();
      parent1Revision = di.readInt();
      parent2Revision = di.readInt();
      di.readFully(nodeid, 1, 20);
      dis.skipBytes(12);
      // CAN'T USE skip() here without extra precautions. E.g. I ran into situation when
      // buffer was 8192 and BufferedInputStream was at position 8182 before attempt to skip(12).
      // BIS silently skips available bytes and leaves me two extra bytes that ruin the rest of the code.
      data = new byte[compressedLen];
      if (inlineData) {
        di.readFully(data);
      } else if (needRevData) {
        dataStream.position(offset);
        dataStream.read(ByteBuffer.wrap(data));
      }
      if (needRevData) {
View Full Code Here

Examples of java.io.DataInput

    assertEquals(root, readNode());
  }

  Node readNode() throws IOException {
    ByteArrayInputStream byteInStream = new ByteArrayInputStream(byteOutStream.toByteArray());
    DataInput in = new DataInputStream(byteInStream);
    return Node.read(in);
  }
View Full Code Here

Examples of java.io.DataInput

    assertEquals(split, readSplit());
  }
 
  protected InMemInputSplit readSplit() throws IOException {
    ByteArrayInputStream byteInStream = new ByteArrayInputStream(byteOutStream.toByteArray());
    DataInput in = new DataInputStream(byteInStream);
    return InMemInputSplit.read(in);
  }
View Full Code Here

Examples of java.io.DataInput

  private static final int nbAttributes = 10;

  private static Dataset readDataset(byte[] bytes) throws IOException {
    ByteArrayInputStream byteInStream = new ByteArrayInputStream(bytes);
    DataInput in = new DataInputStream(byteInStream);
    return Dataset.read(in);
  }
View Full Code Here

Examples of java.io.DataInput

    assertEquals(split, readSplit());
  }
 
  InMemInputSplit readSplit() throws IOException {
    ByteArrayInputStream byteInStream = new ByteArrayInputStream(byteOutStream.toByteArray());
    DataInput in = new DataInputStream(byteInStream);
    return InMemInputSplit.read(in);
  }
View Full Code Here

Examples of java.io.DataInput

        t1.write(out);
        t1.write(out); // twice in a row on purpose
        fos.close();

        FileInputStream fis = new FileInputStream(file);
        DataInput in = new DataInputStream(fis);
        for (int i = 0; i < 2; i++) {
            Tuple after = tf.newTuple();
            after.readFields(in);

            Object o = after.get(0);
View Full Code Here

Examples of java.io.DataInput

        DataOutput out = new DataOutputStream(fos);
        t1.write(out);
        fos.close();

        FileInputStream fis = new FileInputStream(file);
        DataInput in = new DataInputStream(fis);
        Tuple after = tf.newTuple();
        after.readFields(in);

        Object o = after.get(0);
View Full Code Here

Examples of java.io.DataInput

      try {
        if (blockType == BlockType.GENERAL_BLOOM_META) {
          if (this.generalBloomFilter != null)
            return; // Bloom has been loaded

          DataInput bloomMeta = reader.getGeneralBloomFilterMetadata();
          if (bloomMeta != null) {
            // sanity check for NONE Bloom filter
            if (bloomFilterType == BloomType.NONE) {
              throw new IOException(
                  "valid bloom filter type not found in FileInfo");
            } else {
              generalBloomFilter = BloomFilterFactory.createFromMeta(bloomMeta,
                  reader);
              if (LOG.isTraceEnabled()) {
                LOG.trace("Loaded " + bloomFilterType.toString() + " "
                  + generalBloomFilter.getClass().getSimpleName()
                  + " metadata for " + reader.getName());
              }
            }
          }
        } else if (blockType == BlockType.DELETE_FAMILY_BLOOM_META) {
          if (this.deleteFamilyBloomFilter != null)
            return; // Bloom has been loaded

          DataInput bloomMeta = reader.getDeleteBloomFilterMetadata();
          if (bloomMeta != null) {
            deleteFamilyBloomFilter = BloomFilterFactory.createFromMeta(
                bloomMeta, reader);
            LOG.info("Loaded Delete Family Bloom ("
                + deleteFamilyBloomFilter.getClass().getSimpleName()
View Full Code Here

Examples of java.io.DataInput

        throw new DeserializationException(e);
      }
    } else {
      ListMultimap<String,TablePermission> perms = ArrayListMultimap.create();
      try {
        DataInput in = new DataInputStream(new ByteArrayInputStream(data));
        int length = in.readInt();
        for (int i=0; i<length; i++) {
          String user = Text.readString(in);
          List<TablePermission> userPerms =
            (List)HbaseObjectWritableFor96Migration.readObject(in, conf);
          perms.putAll(user, userPerms);
View Full Code Here

Examples of java.io.DataInput

     *
     * @param input the data input for this page
     * @throws java.io.IOException if an exception is thrown
     */
    protected void readMessage(InputStream input) throws IOException {
        DataInput in = new DataInputStream(input);

        readRequestLine(in);
        readHeaders(in);
        readBody(in);

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.