X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMono.Security%2FMono.Security.Protocol.Tls%2FTlsStream.cs;h=cb112e9bdad92d7ca5416e4ee6de9554f8ef6427;hb=6b6435d1b3206b0162c37e5ecce8d9a699fe6467;hp=f21d005edca87ec006cfe66420c7c79c3698ee2c;hpb=deaec6e0d0fe8178e4ab6d524875067e1531f03f;p=mono.git diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs index f21d005edca..cb112e9bdad 100644 --- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs +++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs @@ -1,26 +1,26 @@ -/* Transport Security Layer (TLS) - * Copyright (c) 2003-2004 Carlos Guzman Alvarez - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ +// Transport Security Layer (TLS) +// Copyright (c) 2003-2004 Carlos Guzman Alvarez + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// using System; using System.IO; @@ -61,28 +61,28 @@ namespace Mono.Security.Protocol.Tls public override bool CanWrite { - get { return canWrite; } + get { return this.canWrite; } } public override bool CanRead { - get { return canRead; } + get { return this.canRead; } } public override bool CanSeek { - get { return buffer.CanSeek; } + get { return this.buffer.CanSeek; } } public override long Position { - get { return buffer.Position; } - set { buffer.Position = value; } + get { return this.buffer.Position; } + set { this.buffer.Position = value; } } public override long Length { - get { return buffer.Length; } + get { return this.buffer.Length; } } #endregion @@ -154,13 +154,13 @@ namespace Mono.Security.Protocol.Tls public void Write(byte value) { - WriteByte(value); + this.WriteByte(value); } public void Write(short value) { byte[] bytes = BitConverter.GetBytes((short)IPAddress.HostToNetworkOrder(value)); - Write(bytes); + this.Write(bytes); } public void WriteInt24(int value) @@ -168,26 +168,26 @@ namespace Mono.Security.Protocol.Tls int int24 = IPAddress.HostToNetworkOrder(value); byte[] content = new byte[3]; - System.Array.Copy(BitConverter.GetBytes(int24), 1, content, 0, 3); + Buffer.BlockCopy(BitConverter.GetBytes(int24), 1, content, 0, 3); - Write(content); + this.Write(content); } public void Write(int value) { byte[] bytes = BitConverter.GetBytes((int)IPAddress.HostToNetworkOrder(value)); - Write(bytes); + this.Write(bytes); } public void Write(long value) { byte[] bytes = BitConverter.GetBytes((long)IPAddress.HostToNetworkOrder(value)); - Write(bytes); + this.Write(bytes); } public void Write(byte[] buffer) { - Write(buffer, 0, buffer.Length); + this.Write(buffer, 0, buffer.Length); } #endregion @@ -196,13 +196,13 @@ namespace Mono.Security.Protocol.Tls public void Reset() { - buffer.SetLength(0); - buffer.Position = 0; + this.buffer.SetLength(0); + this.buffer.Position = 0; } public byte[] ToArray() { - return buffer.ToArray(); + return this.buffer.ToArray(); } #endregion @@ -211,22 +211,22 @@ namespace Mono.Security.Protocol.Tls public override void Flush() { - buffer.Flush(); + this.buffer.Flush(); } public override void SetLength(long length) { - buffer.SetLength(length); + this.buffer.SetLength(length); } public override long Seek(long offset, System.IO.SeekOrigin loc) { - return buffer.Seek(offset, loc); + return this.buffer.Seek(offset, loc); } public override int Read(byte[] buffer, int offset, int count) { - if (canRead) + if (this.canRead) { return this.buffer.Read(buffer, offset, count); } @@ -235,7 +235,7 @@ namespace Mono.Security.Protocol.Tls public override void Write(byte[] buffer, int offset, int count) { - if (canWrite) + if (this.canWrite) { this.buffer.Write(buffer, offset, count); }