コード例 #1
0
        public Int64 readInt64()
        {
            byte[] buf = new byte[8];

            if (this.Read(buf, 0, 8) != 8)
            {
                throw new Exception("MemoryInputStream: Could not read int64 from a stream");
            }

            if (littleEndian)
            {
                return(BitConverter.ToInt64(buf, 0));
            }
            else
            {
                return(MyBitConverter.bigEndian_toInt64(buf, 0));
            }
        }
コード例 #2
0
        public short readInt16()
        {
            byte[] buf = new byte[2];

            if (this.Read(buf, 0, 2) != 2)
            {
                throw new Exception("MemoryInputStream: Could not read int16 from a stream");
            }

            if (littleEndian)
            {
                return(BitConverter.ToInt16(buf, 0));
            }
            else
            {
                return(MyBitConverter.bigEndian_toInt16(buf, 0));
            }
        }