Examples of LZFOutputStream


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

        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
        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
        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

                // System.err.println("Created index file " + file.getAbsolutePath());
                FastByteArrayOutputStream buf = new FastByteArrayOutputStream();

                OutputStream fileOut = new BufferedOutputStream(new FileOutputStream(file),
                        1024 * 1024);
                fileOut = new LZFOutputStream(fileOut);
                try {
                    for (Node node : cache) {
                        buf.reset();
                        DataOutput out = new DataOutputStream(buf);
                        try {
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

    }

    protected void writeObject(RevObject object, OutputStream target) {

        ObjectWriter<RevObject> writer = serializationFactory.createObjectWriter(object.getType());
        LZFOutputStream cOut = new LZFOutputStream(target);
        try {
            writer.write(object, cOut);
        } catch (IOException e) {
            throw Throwables.propagate(e);
        } finally {
            try {
                cOut.flush();
                cOut.close();
            } catch (Exception e) {
                throw Throwables.propagate(e);
            }
        }
        // int size = ((ByteArrayOutputStream) target).size();
View Full Code Here

Examples of com.ning.compress.lzf.LZFOutputStream

    }

    private byte[] toBytes(RevObject object) {
        ObjectWriter<RevObject> writer = serializers.createObjectWriter(object.getType());
        ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
        LZFOutputStream cOut = new LZFOutputStream(byteStream);
        try {
            writer.write(object, cOut);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        try {
            cOut.close();
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
        return byteStream.toByteArray();
    }
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

            if (isHeadersCommitted) return;
            isHeadersCommitted = true;

            // constructor writes to underlying OutputStream causing headers to be written.
            // so we swap compressed OutputStream in when we are ready to write.
            lzf = new LZFOutputStream(delegate);
            delegate = lzf;
        }
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
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.