protected StateFunc Params() { NetInt.ReadInt(delta, cmd.Len1, out param1); NetInt.ReadInt(delta, cmd.Len2, out param2); return(PatchRun); }
private StateFunc Magic() { if (NetInt.ReadInt(stream) != Const.RS_SIG_MAGIC) { throw new Exception("Bad signature"); } return(Header); }
private StateFunc Header() { var signature = NetInt.ReadInt(delta); if (signature != Const.RS_DELTA_MAGIC) { throw new Exception(); } return(CommandByte); }
private StateFunc Header() { var blockLength = NetInt.ReadInt(stream); var strongLength = NetInt.ReadInt(stream); processor.Header(blockLength, strongLength); strong = new byte[strongLength]; return(Read); }
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); }
private StateFunc Read() { long weak; if (!NetInt.ReadInt(stream, 4, out weak)) { return(Completed); } stream.Read(strong, 0, strong.Length); processor.Chunk((uint)weak, new StrongSum(strong, StrongSumAlgorithm.Md4)); return(Read); }
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); }
public void Header() { NetInt.Write(delta, Const.RS_DELTA_MAGIC); }