Examples of DataInput


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);
              LOG.info("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

    } catch (Exception e) {
      System.out.println("Unable to retrieve the midkey");
    }

    // Printing general bloom information
    DataInput bloomMeta = reader.getGeneralBloomFilterMetadata();
    BloomFilter bloomFilter = null;
    if (bloomMeta != null)
      bloomFilter = BloomFilterFactory.createFromMeta(bloomMeta, reader);

    System.out.println("Bloom filter:");
View Full Code Here

Examples of java.io.DataInput

      + File.separator + "jars" + File.separator;
    File jarFile = new File(localPath, "MockFilter.jar");
    jarFile.delete();
    assertFalse("Should be deleted: " + jarFile.getPath(), jarFile.exists());

    DataInput dis = ByteStreams.newDataInput(Base64.decode(WRITABLE_GET));
    Get get = new Get();
    try {
      get.readFields(dis);
      fail("Should not be able to load the filter class");
    } catch (RuntimeException re) {
View Full Code Here

Examples of java.io.DataInput

    }

    private NamedColorSpace[] readNamedColors(ICC_Profile profile,
            String profileName, String profileURI) throws IOException {
        byte[] tag = profile.getData(ICC_Profile.icSigNamedColor2Tag);
        DataInput din = new DataInputStream(new ByteArrayInputStream(tag));
        int sig = din.readInt();
        if (sig != NCL2) {
            throw new UnsupportedOperationException("Unsupported structure type: "
                    + toSignatureString(sig) + ". Expected " + toSignatureString(NCL2));
        }
        din.skipBytes(8);
        int numColors = din.readInt();
        NamedColorSpace[] result = new NamedColorSpace[numColors];
        int numDeviceCoord = din.readInt();
        String prefix = readAscii(din, 32);
        String suffix = readAscii(din, 32);
        for (int i = 0; i < numColors; i++) {
            String name = prefix + readAscii(din, 32) + suffix;
            int[] pcs = readUInt16Array(din, 3);
View Full Code Here

Examples of java.io.DataInput

        }
        return result;
    }

    private String readSimpleString(byte[] tag) throws IOException {
        DataInput din = new DataInputStream(new ByteArrayInputStream(tag));
        int sig = din.readInt();
        if (sig == MLUC) {
            return readMLUC(din);
        } else {
            return null; //Unsupported tag structure type
        }
View Full Code Here

Examples of java.io.DataInput

    }
    fileOutStream.flush();
    fileOutStream.close();

    InputStream fInStream = new FileInputStream(f);
    DataInput inpStream = new DataInputStream(fInStream);

    for(int i =0; i < recs.length; i++){
      HowlRecord rec = new DefaultHowlRecord();
      rec.readFields(inpStream);
      Assert.assertEquals(recs[i],rec);
View Full Code Here

Examples of java.io.DataInput

    @Override
    public void handleMessage(final Channel channel, final MessageInputStream message) {
        try {
            ROOT_LOGGER.tracef("%s handling incoming data", this);
            final DataInput input = new SimpleDataInput(Marshalling.createByteInput(message));
            final ManagementProtocolHeader header = ManagementProtocolHeader.parse(input);
            final byte type = header.getType();
            if(type == ManagementProtocol.TYPE_PING) {
                // Handle legacy ping/pong directly
                ROOT_LOGGER.tracef("Received ping on %s", this);
View Full Code Here

Examples of java.io.DataInput

    }
    fileOutStream.flush();
    fileOutStream.close();

    InputStream fInStream = new FileInputStream(f);
    DataInput inpStream = new DataInputStream(fInStream);

    for (int i = 0; i < recs.length; i++) {
      HCatRecord rec = new DefaultHCatRecord();
      rec.readFields(inpStream);
      Assert.assertTrue(HCatDataCheckUtil.recordsEqual(recs[i], rec));
View Full Code Here

Examples of java.io.DataInput

            dataOut.writeByte(NULL_TYPE);
        }
    }

    public Object unmarshal(DataInput dis) throws IOException {
        DataInput dataIn = dis;
        if (!sizePrefixDisabled) {
            dis.readInt();
            // int size = dis.readInt();
            // byte[] data = new byte[size];
            // dis.readFully(data);
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
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.