-/* 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;
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
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)
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
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
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);
}
public override void Write(byte[] buffer, int offset, int count)
{
- if (canWrite)
+ if (this.canWrite)
{
this.buffer.Write(buffer, offset, count);
}