private ByteString Add(PartBytes bytes) { _bytesList.Add(bytes); _length += bytes.Length; return this; }
public PartBytes(PartBytes bytes,int begin,int length) { _bytes = bytes._bytes; if (bytes.Length < begin + length) throw new IndexOutOfRangeException(); _begin = bytes._begin + begin; _length = length; }
public ByteString Drop(int n) { var newBytes = new ByteString(); foreach (PartBytes bytes in _bytesList) { if (n == 0) { newBytes.Add(bytes); } else { var l = bytes.Length; if (l <= n) { // skip n -= l; } else { //byte[] left = new byte[l - n]; //Array.Copy(bytes,n,left,0,l - n); var left = new PartBytes(bytes,n,l - n); newBytes.Add(left); n = 0; } } } return newBytes; }