Ejemplo n.º 1
0
        public void Copy(long start, long length)
        {
            var lStart  = Utils.GetIntLen(start);
            var lLength = Utils.GetIntLen(length);

            var op = ((GetOpcodeOffset(lStart) << 2) + GetOpcodeOffset(lLength)) + 64; // MAGIC

            delta.WriteByte((byte)op);
            NetInt.Write(delta, start, lStart);
            NetInt.Write(delta, length, lLength);
        }
Ejemplo n.º 2
0
        public void Literal(byte[] data, long offset, long count)
        {
            if (count <= 64)
            {
                delta.WriteByte((byte)count);
            }
            else
            {
                var lCount = Utils.GetIntLen(count);
                var op     = GetOpcodeOffset(lCount) + 64;
                delta.WriteByte((byte)op);
                NetInt.Write(delta, count, lCount);
            }

            delta.Write(data, (int)offset, (int)count);
        }
Ejemplo n.º 3
0
 public void Header()
 {
     NetInt.Write(delta, Const.RS_DELTA_MAGIC);
 }