protected override bool Skip(long bytesToSkip, out long bytesSkipped, CefResourceSkipCallback callback) { if (!_stream.CanSeek) { bytesSkipped = -2; return(false); } bytesSkipped = _stream.Seek(bytesToSkip, SeekOrigin.Begin); return(true); }
protected override bool Skip(long bytesToSkip, out long bytesSkipped, CefResourceSkipCallback callback) { //No Stream or Stream cannot seek then we indicate failure if (Stream is null || !Stream.CanSeek) { //Indicate failure bytesSkipped = -2; return(false); } bytesSkipped = bytesToSkip; Stream.Seek(bytesToSkip, SeekOrigin.Current); //If data is available immediately set bytesSkipped to the number of of bytes skipped and return true. return(true); }
protected override bool Skip(long bytesToSkip, out long bytesSkipped, CefResourceSkipCallback callback) { bytesSkipped = (long)CefErrorCode.Failed; return(false); }
protected internal sealed override bool Skip(long bytesToSkip, ref long bytesSkipped, CefResourceSkipCallback callback) { if (bytesToSkip < 0) { bytesSkipped = (long)CefErrorCode.Failed; return(false); } bytesSkipped = Math.Min(_data.Length - _offset, bytesToSkip); if (bytesSkipped == 0) { return(false); } _offset += (int)bytesSkipped; return(true); }
protected override bool Skip(long bytesToSkip, out long bytesSkipped, CefResourceSkipCallback callback) { bytesSkipped = 0; return(true); }
public override bool Skip(long bytesToSkip, ref long bytesSkipped, CefResourceSkipCallback callback) { return(_implementation.Skip(bytesToSkip, ref bytesSkipped, callback)); }
protected override bool Skip(long bytesToSkip, out long bytesSkipped, CefResourceSkipCallback callback) { throw new NotImplementedException(); }
protected internal unsafe override bool Skip(long bytesToSkip, ref long bytesSkipped, CefResourceSkipCallback callback) { return(_implementation.Skip(bytesToSkip, ref bytesSkipped, callback)); }
protected internal sealed override bool Skip(long bytesToSkip, ref long bytesSkipped, CefResourceSkipCallback callback) { if (bytesToSkip < 0) { bytesSkipped = (long)CefErrorCode.Failed; return(false); } if (_stream.CanSeek) { long currentPos = _stream.Position; bytesSkipped = _stream.Seek(bytesToSkip, SeekOrigin.Current) - currentPos; return(bytesSkipped > 0); } var buffer = new byte[BufferSize]; SkipBytesInternal(Task.FromResult(buffer.Length), new SkipState { Buffer = new byte[buffer.Length], BytesToSkip = bytesToSkip, BytesSkipped = -buffer.Length, Callback = callback, }); bytesSkipped = 0; return(true); }