class RpcOutputStream extends FileOutputStream {

	private void readHeader(InputStream inStream, RpcCRC32Checksum crc) throws IOException {
		CheckedInputStream in = new CheckedInputStream(inStream, crc);
		crc.reset();
		// Check header magic
		if (readUShort(in) != GZIP_MAGIC) {
			throw new IOException("Not in GZIP format");
		}
		// Check compression method
		if (readUByte(in) != 8) {
			throw new IOException("Unsupported compression method");
		}
		// Read flags
		int flg = readUByte(in);
		// Skip MTIME, XFL, and OS fields
		skipBytes(in, 6);
		// Skip optional extra field
		if ((flg & FEXTRA) == FEXTRA) {
			skipBytes(in, readUShort(in));
		}
		// Skip optional file name
		if ((flg & FNAME) == FNAME) {
			while (readUByte(in) != 0) ;
		}
		// Skip optional file comment
		if ((flg & FCOMMENT) == FCOMMENT) {
			while (readUByte(in) != 0) ;
		}
		// Check optional header CRC
		if ((flg & FHCRC) == FHCRC) {
			int v = (int) crc.getValue() & 0xffff;
			if (readUShort(in) != v) {
				throw new IOException("Corrupt GZIP header");
			}
		}
	}

	public  RpcOutputStream(RpcPerforceFile file, RpcConnection rpcConnection, boolean useLocalDigester);
	private  RpcOutputStream(RpcPerforceFile file, P4Charset p4Charset, boolean isUnicodeServer, boolean useLocalDigester, int filesys_utf8bom);

}