public override void WriteByte(byte value) { ThrowIfNotCanWrite(); this.stream.WriteByte(value); } protected void ThrowIfNotCanWrite()