コード例 #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));
        }
コード例 #2
0
        protected bool ReadBoolean()
        {
            byte val = (byte)SerializeStream.ReadByte();

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