Exemplo n.º 1
0
 public void ReadValue(long ofs, int len, byte[] buf, int bufOfs)
 {
     lock (_log)
     {
         _log.WriteUInt8((byte)KVReplayOperation.ReadValue);
         _log.WriteVUInt32(TrIndex);
         _log.WriteVInt64(ofs);
         _log.WriteVInt32(len);
         _log.WriteVInt32(bufOfs);
         _log.FlushBuffer();
     }
     _tr.ReadValue(ofs, len, buf, bufOfs);
 }
Exemplo n.º 2
0
        public static byte[] ReadValue(this IKeyValueDBTransaction transaction)
        {
            long valueSize = transaction.GetValueSize();

            if (valueSize < 0)
            {
                return(null);
            }
            if ((int)valueSize != valueSize)
            {
                throw new BTDBException("Value is bigger then 2GB does not fit in byte[]");
            }
            var result = new byte[valueSize];

            transaction.ReadValue(0, (int)valueSize, result, 0);
            return(result);
        }