Example #1
0
        public static ServerInit Deserialize(Util.BinaryReader reader)
        {
            var serverInit = new ServerInit()
            {
                FrameBufferWidth  = reader.ReadUInt16(),
                FrameBufferHeight = reader.ReadUInt16(),
                PixelFormat       = PixelFormat.Deserialize(reader)
            };

            var nameSize = reader.ReadUInt32();

            serverInit.Name = reader.ReadString((int)nameSize);

            return(serverInit);
        }
Example #2
0
 public static PixelFormat Deserialize(Util.BinaryReader reader)
 {
     return(new PixelFormat()
     {
         BitsPerPixel = reader.ReadByte(),
         Depth = reader.ReadByte(),
         BigEndianFlag = reader.ReadByte(),
         TrueColorFlag = reader.ReadByte(),
         RedMax = reader.ReadUInt16(),
         GreenMax = reader.ReadUInt16(),
         BlueMax = reader.ReadUInt16(),
         RedShift = reader.ReadByte(),
         GreenShift = reader.ReadByte(),
         BlueShift = reader.ReadByte(),
         Padding = reader.ReadBytes(3),
     });
 }