Example #1
0
        protected string ReadString()
        {
            int length = SerializeStream.ReadByte();

            byte[] buffer = ReadBytes(length);
            // special empty string handling.  String of length 1 with the first character value = zero
            // represents null value.
            if (length == 1 && buffer[0] == 0)
            {
                return(null);
            }
            return(Encoding.ASCII.GetString(buffer));
        }
Example #2
0
        protected bool ReadBoolean()
        {
            byte val = (byte)SerializeStream.ReadByte();

            return(val == 0 ? false : true);
        }
Example #3
0
 protected char ReadChar()
 {
     return(Converter.ToChar(SerializeStream.ReadByte()));
 }
Example #4
0
 protected byte ReadByte()
 {
     return((byte)SerializeStream.ReadByte());
 }