Examples of SnappyInputStream


Examples of org.xerial.snappy.SnappyInputStream

        boolean compressed = MessagingService.getBits(header, 2, 1) == 1;

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        from = CompactEndpointSerializationHelper.deserialize(in);

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

   * @return
   */
  @Override
  public BSPMessageBundle<M> decompressBundle(BSPCompressedBundle compMsgBundle) {
    ByteArrayInputStream bis = null;
    SnappyInputStream sis = null;
    DataInputStream dis = null;
    BSPMessageBundle<M> bundle = new BSPMessageBundle<M>();

    try {
      byte[] data = compMsgBundle.getData();
      bis = new ByteArrayInputStream(data);
      sis = new SnappyInputStream(bis);
      dis = new DataInputStream(sis);

      bundle.readFields(dis);

    } catch (IOException ioe) {
      LOG.error("Unable to decompress.", ioe);
    } finally {
      try {
        dis.close();
        sis.close();
        bis.close();
      } catch (IOException e) {
        LOG.warn("Failed to close decompression streams.", e);
      }
    }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        boolean compressed = MessagingService.getBits(header, 2, 1) == 1;

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            if (version < MessagingService.VERSION_21)
            {
                in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
            }
            else
            {
                LZ4FastDecompressor decompressor = LZ4Factory.fastestInstance().fastDecompressor();
                Checksum checksum = XXHashFactory.fastestInstance().newStreamingHash32(OutboundTcpConnection.LZ4_HASH_SEED).asChecksum();
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

   * @return The result after decompressing BSPCompressedBundle.
   */
  @Override
  public byte[] decompress(byte[] compressedBytes) {
    ByteArrayInputStream bis = null;
    SnappyInputStream sis = null;
    DataInputStream dis = null;
    byte[] bytes = null;

    try {
      bis = new ByteArrayInputStream(compressedBytes);
      sis = new SnappyInputStream(bis);
      dis = new DataInputStream(sis);

      bytes = IOUtils.toByteArray(dis);
    } catch (IOException ioe) {
      LOG.error("Unable to decompress.", ioe);
    } finally {
      try {
        dis.close();
        sis.close();
        bis.close();
      } catch (IOException e) {
        LOG.warn("Failed to close decompression streams.", e);
      }
    }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        from = CompactEndpointSerializationHelper.deserialize(in);

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        boolean compressed = MessagingService.getBits(header, 2, 1) == 1;

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        from = CompactEndpointSerializationHelper.deserialize(in);

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
View Full Code Here

Examples of org.xerial.snappy.SnappyInputStream

        boolean compressed = MessagingService.getBits(header, 2, 1) == 1;

        if (compressed)
        {
            logger.debug("Upgrading incoming connection to be compressed");
            in = new DataInputStream(new SnappyInputStream(socket.getInputStream()));
        }
        else
        {
            in = new DataInputStream(new BufferedInputStream(socket.getInputStream(), 4096));
        }
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.