示例#1
0
文件: Packet.cs 项目: hexcoded/PVO
        public String ReadAscii(int codepage)
        {
            lock (m_lock)
            {
                if (!m_locked)
                {
                    throw new Exception("Cannot Read from an unlocked Packet.");
                }

                UInt16 length = m_reader.ReadUInt16();
                byte[] bytes  = m_reader.ReadBytes(length);

                return(Encoding.GetEncoding(codepage).GetString(bytes));
            }
        }