Package io.apigee.trireme.core.internal

Examples of io.apigee.trireme.core.internal.GZipHeader.store()


                   checksum = new CRC32();

                   GZipHeader hdr = new GZipHeader();
                   hdr.setTimestamp(System.currentTimeMillis());
                   Buffer.BufferImpl buf =
                       Buffer.BufferImpl.newBuffer(cx, this, hdr.store(), false);
                   log.debug("Sending GZIP header");
                   cb.call(cx, this, this, new Object[] { Context.getUndefinedValue(), buf, false });
               }
               headerDone = true;
            }
View Full Code Here


        throws DataFormatException
    {
        final long now = System.currentTimeMillis();
        GZipHeader origHeader = new GZipHeader();
        origHeader.setTimestamp(now);
        ByteBuffer buf = origHeader.store();
        GZipHeader hdr = GZipHeader.load(buf);
        assertNotNull(hdr);
        assertNull(hdr.getFileName());
        assertNull(hdr.getComment());
        assertEquals((now / 1000L) * 1000L, hdr.getTimestamp());
View Full Code Here

    {
        final String NAME = "/usr/local/bin/emacs";

        GZipHeader origHeader = new GZipHeader();
        origHeader.setFileName(NAME);
        ByteBuffer buf = origHeader.store();
        GZipHeader hdr = GZipHeader.load(buf);
        assertNotNull(hdr);
        assertEquals(NAME, hdr.getFileName());
        assertNull(hdr.getComment());
    }
View Full Code Here

    {
        final String NAME = "";

        GZipHeader origHeader = new GZipHeader();
        origHeader.setFileName(NAME);
        ByteBuffer buf = origHeader.store();
        GZipHeader hdr = GZipHeader.load(buf);
        assertNotNull(hdr);
        assertEquals(NAME, hdr.getFileName());
        assertNull(hdr.getComment());
    }
View Full Code Here

        final String COMMENT = "This is a comment that someone might insert in a ZIP file";

        GZipHeader origHeader = new GZipHeader();
        origHeader.setFileName(NAME);
        origHeader.setComment(COMMENT);
        ByteBuffer buf = origHeader.store();
        GZipHeader hdr = GZipHeader.load(buf);
        assertNotNull(hdr);
        assertEquals(NAME, hdr.getFileName());
        assertEquals(COMMENT, hdr.getComment());
    }
View Full Code Here

        final String COMMENT = "This is a comment that someone might insert in a ZIP file";

        GZipHeader origHeader = new GZipHeader();
        origHeader.setFileName(NAME);
        origHeader.setComment(COMMENT);
        ByteBuffer buf = origHeader.store();
        GZipHeader hdr;

        int origLimit = buf.limit();
        buf.limit(5);
        hdr = GZipHeader.load(buf);
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.