class RpcOutputStream extends FileOutputStream {

	@Override
	public void close() throws IOException {
		if (!closed) {
			closed = true;
			switch (this.fileType) {
				case FST_UTF16:
				case FST_XUTF16:
				case FST_UTF8:
				case FST_XUTF8:
				case FST_UNICODE:
				case FST_XUNICODE:
				case FST_TEXT:
				case FST_XTEXT:
					if (this.lineEndStream != null) {
						this.lineEndStream.close();
					}
					break;

				case FST_GUNZIP:
				case FST_XGUNZIP:
					readTrailer(this.footerBytes);
					this.outStream.close();
					this.checkedOutStream.close();
					break;
				default:
					break;
			}
			super.close();
		}
	}

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

}