Examples of LZFOutputStream


Examples of com.ning.compress.lzf.LZFOutputStream

  }

  public static void compress(InputStream in, OutputStream out)
      throws IOException
  {
    LZFOutputStream compressor = null;
    boolean success = true;

    try {
      compressor = new LZFOutputStream(out);
      byte[] buf = ThreadLocalByteBuffer.getBuffer();
      int len;

      while ((len = in.read(buf)) != -1) {
        compressor.write(buf, 0, len);
      }

      compressor.close();
    } catch (IOException e) {
      success = false;
      throw new IllegalStateException(e.getMessage(), e);
    } finally {
      if (!success && (compressor != null)) {
        compressor.close();
      }
    }
  }
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

        RandomAccessReader file = (header.file.sstable.compression) // try to skip kernel page cache if possible
                                ? CompressedRandomAccessReader.open(header.file.getFilename(), header.file.sstable.getCompressionMetadata(), true)
                                : RandomAccessReader.open(new File(header.file.getFilename()), true);

        // setting up data compression stream
        compressedoutput = new LZFOutputStream(output);

        MessagingService.instance().incrementActiveStreamsOutbound();
        try
        {
            // stream each of the required sections of the file
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

        RandomAccessReader file = (header.file.sstable.compression) // try to skip kernel page cache if possible
                                ? CompressedRandomAccessReader.open(header.file.getFilename(), header.file.sstable.getCompressionMetadata(), true)
                                : RandomAccessReader.open(new File(header.file.getFilename()), true);

        // setting up data compression stream
        output = new LZFOutputStream(output);

        try
        {
            // stream each of the required sections of the file
            for (Pair<Long, Long> section : header.file.sections)
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

            validator = DataIntegrityMetadata.checksumValidator(sstable.descriptor);

        transferBuffer = validator == null ? new byte[DEFAULT_CHUNK_SIZE] : new byte[validator.chunkSize];

        // setting up data compression stream
        compressedOutput = new LZFOutputStream(Channels.newOutputStream(channel));
        long progress = 0L;

        try
        {
            // stream each of the required sections of the file
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

        RandomAccessReader file = (header.file.sstable.compression) // try to skip kernel page cache if possible
                                ? CompressedRandomAccessReader.open(header.file.getFilename(), true)
                                : RandomAccessReader.open(new File(header.file.getFilename()), true);

        // setting up data compression stream
        output = new LZFOutputStream(output);

        try
        {
            // stream each of the required sections of the file
            for (Pair<Long, Long> section : header.file.sections)
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

        // try to skip kernel page cache if possible
        RandomAccessReader file = RandomAccessReader.open(new File(header.file.getFilename()), true);

        // setting up data compression stream
        compressedoutput = new LZFOutputStream(output);

        StreamingMetrics.activeStreamsOutbound.inc();
        try
        {
            long totalBytesTransferred = 0;
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

        RandomAccessReader file = (header.file.sstable.compression) // try to skip kernel page cache if possible
                                ? CompressedRandomAccessReader.open(header.file.getFilename(), header.file.sstable.getCompressionMetadata(), true)
                                : RandomAccessReader.open(new File(header.file.getFilename()), true);

        // setting up data compression stream
        output = new LZFOutputStream(output);

        try
        {
            // stream each of the required sections of the file
            for (Pair<Long, Long> section : header.file.sections)
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

                                    ? DataIntegrityMetadata.checksumValidator(sstable.descriptor)
                                    : null;
        transferBuffer = validator == null ? new byte[DEFAULT_CHUNK_SIZE] : new byte[validator.chunkSize];

        // setting up data compression stream
        compressedOutput = new LZFOutputStream(Channels.newOutputStream(channel));
        long progress = 0L;

        try
        {
            // stream each of the required sections of the file
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

            validator = DataIntegrityMetadata.checksumValidator(sstable.descriptor);

        transferBuffer = validator == null ? new byte[DEFAULT_CHUNK_SIZE] : new byte[validator.chunkSize];

        // setting up data compression stream
        compressedOutput = new LZFOutputStream(Channels.newOutputStream(channel));
        long progress = 0L;

        try
        {
            // stream each of the required sections of the file
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

        // try to skip kernel page cache if possible
        RandomAccessReader file = RandomAccessReader.open(new File(header.file.getFilename()), true);

        // setting up data compression stream
        compressedoutput = new LZFOutputStream(output);

        StreamingMetrics.activeStreamsOutbound.inc();
        try
        {
            long totalBytesTransferred = 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.