Examples of LZFInputStream


Examples of com.ning.compress.lzf.LZFInputStream

            }

            assert remoteFile.estimatedKeys > 0;
            SSTableReader reader = null;
            logger.debug("Estimated keys {}", remoteFile.estimatedKeys);
            DataInputStream dis = new DataInputStream(new LZFInputStream(socket.getInputStream()));
            try
            {
                reader = streamIn(dis, localFile, remoteFile);
            }
            catch (IOException ex)
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        desc = Descriptor.fromFilename(cfs.getTempSSTablePath(cfs.directories.getLocationForDisk(localDir)));

        SSTableWriter writer = new SSTableWriter(desc.filenameFor(Component.DATA), estimatedKeys);
        try
        {
            DataInputStream dis = new DataInputStream(new LZFInputStream(Channels.newInputStream(channel)));
            BytesReadTracker in = new BytesReadTracker(dis);

            while (in.getBytesRead() < totalSize)
            {
                writeRow(writer, in, cfs);
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        if (comp != null) {
            switch (comp) {
            case NONE:
                break;
            case LZF:
                return new LZFInputStream(in);
            case GZIP:
                return new OptimizedGZIPInputStream(in);
            default: // sanity check
                throw new IllegalArgumentException("Unrecognized compression type: "+comp);
            }
View Full Code Here

Examples of com.ning.compress.lzf.LZFInputStream

        byte[] data = entry.getData();
        InputStream in = new ByteArrayInputStream(data, entry.getOffset(), entry.getSize());

        try {
            if (compress) {
                in = new LZFInputStream(in);
            }
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
        T info;
View Full Code Here

Examples of org.h2.compress.LZFInputStream

        OutputStream fo = IOUtils.openFileOutputStream(fileName, false);
        LZFOutputStream out = new LZFOutputStream(fo);
        out.write("Hello".getBytes());
        out.close();
        InputStream fi = IOUtils.openFileInputStream(fileName);
        LZFInputStream in = new LZFInputStream(fi);
        byte[] buff = new byte[100];
        assertEquals(5, in.read(buff));
        in.read();
        in.close();
        IOUtils.delete(getBaseDir() + "/temp");
    }
View Full Code Here

Examples of org.h2.compress.LZFInputStream

                }
            }
            comp.close();
            byte[] compressed = out.toByteArray();
            ByteArrayInputStream in = new ByteArrayInputStream(compressed);
            LZFInputStream decompress = new LZFInputStream(in);
            byte[] test = new byte[buffer.length];
            for (int j = 0; j < buffer.length;) {
                int[] sizes = { 0, 1, random.nextInt(100), random.nextInt(100000) };
                int size = sizes[random.nextInt(sizes.length)];
                if (size == 1) {
                    int x = decompress.read();
                    if (x < 0) {
                        break;
                    }
                    test[j++] = (byte) x;
                } else {
                    size = Math.min(size, test.length - j);
                    int l = decompress.read(test, j, size);
                    if (l < 0) {
                        break;
                    }
                    j += l;
                }
View Full Code Here

Examples of org.h2.compress.LZFInputStream

                }
                in = z;
            } else if ("DEFLATE".equals(compressionAlgorithm)) {
                in = new InflaterInputStream(in);
            } else if ("LZF".equals(compressionAlgorithm)) {
                in = new LZFInputStream(in);
            } else if (compressionAlgorithm != null) {
                throw DbException.get(ErrorCode.UNSUPPORTED_COMPRESSION_ALGORITHM_1, compressionAlgorithm);
            }
            return in;
        } catch (IOException e) {
View Full Code Here

Examples of org.h2.compress.LZFInputStream

                }
                in = z;
            } else if ("DEFLATE".equals(compressionAlgorithm)) {
                in = new InflaterInputStream(in);
            } else if ("LZF".equals(compressionAlgorithm)) {
                in = new LZFInputStream(in);
            } else if (compressionAlgorithm != null) {
                throw DbException.get(ErrorCode.UNSUPPORTED_COMPRESSION_ALGORITHM_1, compressionAlgorithm);
            }
            return in;
        } catch (IOException e) {
View Full Code Here

Examples of org.lealone.compress.LZFInputStream

                }
                in = z;
            } else if ("DEFLATE".equals(compressionAlgorithm)) {
                in = new InflaterInputStream(in);
            } else if ("LZF".equals(compressionAlgorithm)) {
                in = new LZFInputStream(in);
            } else if (compressionAlgorithm != null) {
                throw DbException.get(ErrorCode.UNSUPPORTED_COMPRESSION_ALGORITHM_1, compressionAlgorithm);
            }
            return in;
        } catch (IOException e) {
View Full Code Here

Examples of xbird.util.compress.LZFInputStream

            throw new XQRemoteException(e);
        }
        final FastByteArrayInputStream fis = new FastByteArrayInputStream(fetchedData);
        final InputStream is;
        try {
            is = compressed ? new LZFInputStream(fis) : fis;
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
        int fetched = fetchInternal(is);
        return fetched;
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.