示例#1
0
        public override int Get3ByteInt(long index, int offset)
        {
            long address  = address(index, offset);
            int  lowWord  = UnsafeUtil.getShort(address) & 0xFFFF;
            int  highByte = UnsafeUtil.getByte(address + Short.BYTES) & 0xFF;
            int  result   = lowWord | (highByte << (sizeof(short) * 8));

            return(result == 0xFFFFFF ? -1 : result);
        }
示例#2
0
        public override long Get5ByteLong(long index, int offset)
        {
            long address = address(index, offset);
            long low4b   = GetInt(address) & 0xFFFFFFFFL;
            long high1b  = UnsafeUtil.getByte(address + Integer.BYTES) & 0xFF;
            long result  = low4b | (high1b << 32);

            return(result == 0xFFFFFFFFFFL ? -1 : result);
        }
示例#3
0
        public override void Get(long index, sbyte[] into)
        {
            long address = address(index, 0);

            for (int i = 0; i < itemSize; i++, address++)
            {
                into[i] = UnsafeUtil.getByte(address);
            }
        }
示例#4
0
 private sbyte GetByte(long p)
 {
     return(UnsafeUtil.getByte(p));
 }
示例#5
0
 public override sbyte GetByte(long index, int offset)
 {
     return(UnsafeUtil.getByte(Address(index, offset)));
 }