ReadBytes() public static method

Reads a length delimited byte array
public static ReadBytes ( System.Stream stream ) : byte[]
stream System.Stream
return byte[]
Ejemplo n.º 1
0
        public static void SkipBytes(Stream stream)
        {
            int num = (int)ProtocolParser.ReadUInt32(stream);

            if (!stream.CanSeek)
            {
                ProtocolParser.ReadBytes(stream);
                return;
            }
            stream.Seek((long)num, SeekOrigin.Current);
        }
Ejemplo n.º 2
0
 public static string ReadString(Stream stream)
 {
     byte[] bytes = ProtocolParser.ReadBytes(stream);
     return(Encoding.UTF8.GetString(bytes, 0, bytes.Length));
 }
Ejemplo n.º 3
0
 public static byte[] ReadBytes(this Stream stream)
 {
     return(ProtocolParser.ReadBytes(stream));
 }