public int read() throws IOException { if (getDeflatedBufferAvail() == 0) { primeDeflateBuffer(); } if (EOFTail) { return -1; } else { return (int) deflatedBytes[bufferOffset++] & 0xFF; } }
public GZipDeflatingInputStream(InputStream inputStream) throws IOException { this.inputStream = inputStream; crc.reset(); // Write the GZip Header. int GZIP_MAGIC = 0x8b1f; writeShort(GZIP_MAGIC); // Magic number deflatedBytes[bufferEnd++] = (byte) Deflater.DEFLATED; // Compression method (CM) deflatedBytes[bufferEnd++] = 0; // Flags (FLG) writeInt(0); // Modification time (MTIME) deflatedBytes[bufferEnd++] = 0; // Extra flags (XFL) deflatedBytes[bufferEnd++] = 0; // Operating system (OS) }
private void writeInt(int i) { writeShort(i & 0xffff); writeShort((i >> 16) & 0xffff); }
inputStream = new GZipDeflatingInputStream(inputStream); contentEncoding = "gzip"; s3Object.addMetadata(Constants.METADATA_JETS3T_COMPRESSED, "gzip");
private void writeInt(int i) { writeShort(i & 0xffff); writeShort((i >> 16) & 0xffff); }
inputStream = new GZipDeflatingInputStream(inputStream); contentEncoding = "gzip"; s3Object.addMetadata(Constants.METADATA_JETS3T_COMPRESSED, "gzip");
public int available() throws IOException { if (EOFTail) { return -1; } else if (getDeflatedBufferAvail() == 0) { primeDeflateBuffer(); } return getDeflatedBufferAvail(); }
public GZipDeflatingInputStream(InputStream inputStream) throws IOException { this.inputStream = inputStream; crc.reset(); // Write the GZip Header. int GZIP_MAGIC = 0x8b1f; writeShort(GZIP_MAGIC); // Magic number deflatedBytes[bufferEnd++] = (byte) Deflater.DEFLATED; // Compression method (CM) deflatedBytes[bufferEnd++] = 0; // Flags (FLG) writeInt(0); // Modification time (MTIME) deflatedBytes[bufferEnd++] = 0; // Extra flags (XFL) deflatedBytes[bufferEnd++] = 0; // Operating system (OS) }
public int available() throws IOException { if (EOFTail) { return -1; } else if (getDeflatedBufferAvail() == 0) { primeDeflateBuffer(); } return getDeflatedBufferAvail(); }
public int read() throws IOException { if (getDeflatedBufferAvail() == 0) { primeDeflateBuffer(); } if (EOFTail) { return -1; } else { return (int) deflatedBytes[bufferOffset++] & 0xFF; } }
public int read(byte[] b, int off, int len) throws IOException { if (getDeflatedBufferAvail() == 0) { primeDeflateBuffer(); } if (EOFTail) { return -1; } else { if (len > getDeflatedBufferAvail()) { // More data requested than is available in the buffer, return everything we have. int bytesAvailable = getDeflatedBufferAvail(); System.arraycopy(deflatedBytes, bufferOffset, b, off, bytesAvailable); bufferOffset = 0; bufferEnd = 0; return bytesAvailable; } else { // Return some of the data we have buffered. System.arraycopy(deflatedBytes, bufferOffset, b, off, len); bufferOffset += len; return len; } } }
public int read(byte[] b, int off, int len) throws IOException { if (getDeflatedBufferAvail() == 0) { primeDeflateBuffer(); } if (EOFTail) { return -1; } else { if (len > getDeflatedBufferAvail()) { // More data requested than is available in the buffer, return everything we have. int bytesAvailable = getDeflatedBufferAvail(); System.arraycopy(deflatedBytes, bufferOffset, b, off, bytesAvailable); bufferOffset = 0; bufferEnd = 0; return bytesAvailable; } else { // Return some of the data we have buffered. System.arraycopy(deflatedBytes, bufferOffset, b, off, len); bufferOffset += len; return len; } } }