public void finish() throws IOException {
    // Finish the Compressed Data field.
    filterChain.finish();
    validate();

    // Block Padding
    for (long i = outCounted.getSize(); (i & 3) != 0; ++i) out.write(0x00);

    // Check
    out.write(check.finish());
  }
 public void flush() throws IOException {
   filterChain.flush();
   validate();
 }
 public void write(byte[] buf, int off, int len) throws IOException {
   filterChain.write(buf, off, len);
   check.update(buf, off, len);
   uncompressedSize += len;
   validate();
 }
Beispiel #4
0
 public void close() throws IOException {
   writeEndMarker();
   out.close();
 }
Beispiel #5
0
 public void finish() throws IOException {
   writeEndMarker();
   out.finish();
 }
Beispiel #6
0
 private void writeEndMarker() throws IOException {
   // TODO: Flush incomplete chunk.
   out.write(0x00);
 }
Beispiel #7
0
 private void writeChunk(byte[] buf, int off, int len) throws IOException {
   out.write(0x01);
   out.write((len - 1) >>> 8);
   out.write(len - 1);
   out.write(buf, off, len);
 }