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)); }
protected bool ReadBoolean() { byte val = (byte)SerializeStream.ReadByte(); return(val == 0 ? false : true); }
protected char ReadChar() { return(Converter.ToChar(SerializeStream.ReadByte())); }
protected byte ReadByte() { return((byte)SerializeStream.ReadByte()); }