Author: alanmc
Date: 2008-01-27 18:08:20 -0500 (Sun, 27 Jan 2008)
New Revision: 94096
Modified:
trunk/bitsharp/src/MonoTorrent/Client/Messages/Message.cs
Log:
Marked Read and Write as static
Modified: trunk/bitsharp/src/MonoTorrent/Client/Messages/Message.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Client/Messages/Message.cs 2008-01-27
22:23:00 UTC (rev 94095)
+++ trunk/bitsharp/src/MonoTorrent/Client/Messages/Message.cs 2008-01-27
23:08:20 UTC (rev 94096)
@@ -30,65 +30,65 @@
return Encode(buffer.Array, buffer.Offset + offset);
}
- protected short ReadShort(byte[] buffer, int offset)
+ static protected short ReadShort(byte[] buffer, int offset)
{
return IPAddress.NetworkToHostOrder(BitConverter.ToInt16(buffer,
offset));
}
- protected int ReadInt(byte[] buffer, int offset)
+ static protected int ReadInt(byte[] buffer, int offset)
{
return IPAddress.NetworkToHostOrder(BitConverter.ToInt32(buffer,
offset));
}
- protected long ReadLong(byte[] buffer, int offset)
+ static protected long ReadLong(byte[] buffer, int offset)
{
return IPAddress.NetworkToHostOrder(BitConverter.ToInt64(buffer,
offset));
}
- protected int Write(byte[] buffer, int offset, byte value)
+ static protected int Write(byte[] buffer, int offset, byte value)
{
buffer[offset] = value;
return 1;
}
- protected int Write(byte[] buffer, int offset, byte[] value)
+ static protected int Write(byte[] buffer, int offset, byte[] value)
{
Buffer.BlockCopy(value, 0, buffer, offset, value.Length);
return value.Length;
}
- protected int Write(byte[] buffer, int offset, ushort value)
+ static protected int Write(byte[] buffer, int offset, ushort value)
{
return Write(buffer, offset, (short)value);
}
- protected int Write(byte[] buffer, int offset, short value)
+ static protected int Write(byte[] buffer, int offset, short value)
{
byte[] temp =
BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value));
Buffer.BlockCopy(temp, 0, buffer, offset, temp.Length);
return temp.Length;
- }
+ }
- protected int Write(byte[] buffer, int offset, int value)
+ static protected int Write(byte[] buffer, int offset, int value)
{
byte[] temp =
BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value));
Buffer.BlockCopy(temp, 0, buffer, offset, temp.Length);
return temp.Length;
}
- protected int Write(byte[] buffer, int offset, uint value)
+ static protected int Write(byte[] buffer, int offset, uint value)
{
return Write(buffer, offset, (int)value);
}
- protected int Write(byte[] buffer, int offset, long value)
+ static protected int Write(byte[] buffer, int offset, long value)
{
byte[] temp =
BitConverter.GetBytes(IPAddress.HostToNetworkOrder(value));
Buffer.BlockCopy(temp, 0, buffer, offset, temp.Length);
return temp.Length;
}
- protected int Write(byte[] buffer, int offset, ulong value)
+ static protected int Write(byte[] buffer, int offset, ulong value)
{
return Write(buffer, offset, (long)value);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches