예제 #1
0
 public static char ReadChar(this Stream stream)
 {
     byte[] buffer = new byte[sizeof(char)];
     stream.Read(buffer, 0, buffer.Length);
     return(BytesTool.CharacterFromBytes(buffer));
 }
예제 #2
0
 public static uint ReadUnsignedInteger(this Stream stream)
 {
     byte[] buffer = new byte[sizeof(uint)];
     stream.Read(buffer, 0, buffer.Length);
     return(BytesTool.UnsignedIntegerFromBytes(buffer));
 }
예제 #3
0
 public static ulong ReadUnsignedLong(this Stream stream)
 {
     byte[] buffer = new byte[sizeof(ulong)];
     stream.Read(buffer, 0, buffer.Length);
     return(BytesTool.UnsignedLongFromBytes(buffer));
 }
예제 #4
0
 public static ushort ReadUnsignedShort(this Stream stream)
 {
     byte[] buffer = new byte[sizeof(ushort)];
     stream.Read(buffer, 0, buffer.Length);
     return(BytesTool.UnsignedShortFromBytes(buffer));
 }
예제 #5
0
 public static float ReadFloat(this Stream stream)
 {
     byte[] buffer = new byte[sizeof(float)];
     stream.Read(buffer, 0, buffer.Length);
     return(BytesTool.FloatFromBytes(buffer));
 }
예제 #6
0
 public static double ReadDouble(this Stream stream)
 {
     byte[] buffer = new byte[sizeof(double)];
     stream.Read(buffer, 0, buffer.Length);
     return(BytesTool.DoubleFromBytes(buffer));
 }