throws DataFormatException
{
final String NAME = "/usr/local/bin/emacs";
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);
assertNull(hdr);
buf.limit(13);
hdr = GZipHeader.load(buf);
assertNull(hdr);
buf.limit(origLimit);
hdr = GZipHeader.load(buf);
assertNotNull(hdr);
assertEquals(NAME, hdr.getFileName());
assertEquals(COMMENT, hdr.getComment());
}