Package org.jwat.gzip

Examples of org.jwat.gzip.GzipReader


        if (offset < -1) {
            throw new IllegalArgumentException(
                    "The 'offset' is less than -1: " + offset);
        }
        currentRecord = null;
        currentReader = new GzipReader(rin);
        currentEntry = currentReader.getNextEntry();
        if (currentEntry != null) {
            ByteCountingPushBackInputStream pbin =
                    new ByteCountingPushBackInputStream(
                            currentEntry.getInputStream(), PUSHBACK_BUFFER_SIZE);
View Full Code Here


            throw new IllegalArgumentException(
                    "The 'buffer_size' is less than or equal to zero: "
                    + buffer_size);
        }
        currentRecord = null;
        currentReader = new GzipReader(rin);
        currentEntry = currentReader.getNextEntry();
        if (currentEntry != null) {
            ByteCountingPushBackInputStream pbin =
                    new ByteCountingPushBackInputStream(
                            new BufferedInputStream(
View Full Code Here

            @Override
            public void close() throws IOException {
                throw new IOException();
            }
        };
        GzipReader gzipReader = new GzipReader(in) {
            @Override
            public void close() throws IOException {
                throw new IOException();
            }
        };
View Full Code Here

            } catch (IllegalArgumentException e) {
                readerCompressed = null;
            }
            Assert.assertNull(readerCompressed);

            GzipReader gzipReader = new GzipReader(new ByteArrayInputStream(new byte[] {42}));

            readerCompressed = new WarcReaderCompressed();
            try {
                readerCompressed = new WarcReaderCompressed(gzipReader, -1);
            } catch (IllegalArgumentException e) {
                readerCompressed = null;
            }
            Assert.assertNull(readerCompressed);

            readerCompressed = new WarcReaderCompressed();
            try {
                readerCompressed = new WarcReaderCompressed(gzipReader, 0);
            } catch (IllegalArgumentException e) {
                readerCompressed = null;
            }
            Assert.assertNull(readerCompressed);

            gzipReader.close();
            gzipReader = null;

            readerCompressed = new WarcReaderCompressed();
            try {
                readerCompressed.getNextRecord();
View Full Code Here

            @Override
            public void close() throws IOException {
                throw new IOException();
            }
        };
        GzipReader gzipReader = new GzipReader(in) {
            @Override
            public void close() throws IOException {
                throw new IOException();
            }
        };
View Full Code Here

        } catch (IllegalArgumentException e) {
            readerCompressed = null;
        }
        Assert.assertNull(readerCompressed);

        GzipReader gzipReader = new GzipReader(new ByteArrayInputStream(new byte[] {42}));

        readerCompressed = new ArcReaderCompressed();
        try {
            readerCompressed = new ArcReaderCompressed(gzipReader, -1);
        } catch (IllegalArgumentException e) {
            readerCompressed = null;
        }
        Assert.assertNull(readerCompressed);

        readerCompressed = new ArcReaderCompressed();
        try {
            readerCompressed = new ArcReaderCompressed(gzipReader, 0);
        } catch (IllegalArgumentException e) {
            readerCompressed = null;
        }
        Assert.assertNull(readerCompressed);

        gzipReader.close();
        gzipReader = null;

        readerCompressed = new ArcReaderCompressed();
        try {
            readerCompressed.getNextRecord();
View Full Code Here

        ByteCountingPushBackInputStream pbin =
                new ByteCountingPushBackInputStream(
                        new BufferedInputStream(in, buffer_size),
                                                PUSHBACK_BUFFER_SIZE);
        if (GzipReader.isGzipped(pbin)) {
            return new ArcReaderCompressed(new GzipReader(pbin),
                                           buffer_size);
        }
        return new ArcReaderUncompressed(pbin);
    }
View Full Code Here

                    "The inputstream 'in' is null");
        }
        ByteCountingPushBackInputStream pbin =
                new ByteCountingPushBackInputStream(in, PUSHBACK_BUFFER_SIZE);
        if (GzipReader.isGzipped(pbin)) {
            return new ArcReaderCompressed(new GzipReader(pbin));
        }
        return new ArcReaderUncompressed(pbin);
    }
View Full Code Here

                                                        throws IOException {
        if (in == null) {
            throw new IllegalArgumentException(
                    "The inputstream 'in' is null");
        }
        return new ArcReaderCompressed(new GzipReader(in));
    }
View Full Code Here

        if (buffer_size <= 0) {
            throw new IllegalArgumentException(
                    "The 'buffer_size' is less than or equal to zero: "
                    + buffer_size);
        }
        return new ArcReaderCompressed(new GzipReader(
                                new BufferedInputStream(in, buffer_size)));
    }
View Full Code Here

TOP

Related Classes of org.jwat.gzip.GzipReader

Copyright © 2018 www.massapicom. 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.