/// <summary>
 /// Reads a block of bytes from the stream and writes the data in a given buffer.
 /// </summary>
 /// <param name="buffer">When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. </param>
 /// <param name="offset">The byte offset in array at which the read bytes will be placed. </param>
 /// <param name="count">The maximum number of bytes to read. </param>
 /// <returns>The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached. </returns>
 public int Read(byte[] buffer, int offset, int count)
 {
     return(FileStreamInstance.Read(buffer, offset, count));
 }
 /// <summary>
 /// Reads a byte from the file and advances the read position one byte.
 /// </summary>
 /// <returns>The byte, cast to an Int32, or -1 if the end of the stream has been reached.</returns>
 public int ReadByte()
 {
     return(FileStreamInstance.ReadByte());
 }
 public async Task FlushAsync()
 {
     await FileStreamInstance.FlushAsync();
 }
 /// <inheritdoc />
 public virtual void Lock(long position, long length)
 {
     FileStreamInstance.Lock(position, length);
 }
 /// <inheritdoc />
 public void Dispose()
 {
     FileStreamInstance.Dispose();
 }
 /// <summary>
 /// Writes a block of bytes to this stream using data from a buffer.
 /// </summary>
 /// <param name="buffer">The buffer containing data to write to the stream.</param>
 /// <param name="offset">The zero-based byte offset in array at which to begin copying bytes to the current stream.</param>
 /// <param name="count">The number of bytes to be written to the current stream.</param>
 public void Write(byte[] buffer, int offset, int count)
 {
     FileStreamInstance.Write(buffer, offset, count);
 }
 /// <summary>
 /// Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
 /// </summary>
 public void Close()
 {
     FileStreamInstance.Close();
 }
 /// <summary>
 /// Sets the length of this stream to the given value.
 /// </summary>
 /// <param name="value">The new length of the stream.</param>
 public void SetLength(long value)
 {
     FileStreamInstance.SetLength(value);
 }
 public async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 {
     await FileStreamInstance.WriteAsync(buffer, offset, count, cancellationToken);
 }
 public IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, AsyncCallback userCallback, object stateObject)
 {
     return(FileStreamInstance.BeginWrite(array, offset, numBytes, userCallback, stateObject));
 }
Beispiel #11
0
 public async Task WriteAsync(byte[] buffer, int offset, int count)
 {
     await FileStreamInstance.WriteAsync(buffer, offset, count);
 }
Beispiel #12
0
 public async Task <int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 {
     return(await FileStreamInstance.ReadAsync(buffer, offset, count, cancellationToken));
 }
Beispiel #13
0
 public async Task <int> ReadAsync(byte[] buffer, int offset, int count)
 {
     return(await FileStreamInstance.ReadAsync(buffer, offset, count));
 }
 /// <summary>
 /// Sets the current position of this stream to the given value.
 /// </summary>
 /// <param name="offset">The point relative to origin from which to begin seeking.</param>
 /// <param name="origin">Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type SeekOrigin. </param>
 /// <returns>The new position in the stream.</returns>
 public long Seek(long offset, SeekOrigin origin)
 {
     return(FileStreamInstance.Seek(offset, origin));
 }
 /// <summary>
 /// Waits for the pending asynchronous read to complete.
 /// </summary>
 /// <param name="asyncResult">The reference to the pending asynchronous request to wait for.</param>
 /// <returns>The number of bytes read from the stream, between 0 and the number of bytes you requested. Streams only return 0 at the end of the stream, otherwise, they should block until at least 1 byte is available.</returns>
 public int EndRead(IAsyncResult asyncResult)
 {
     return(FileStreamInstance.EndRead(asyncResult));
 }
 /// <inheritdoc />
 public void SetAccessControl(IFileSecurityWrap fileSecurity)
 {
     FileStreamInstance.SetAccessControl(fileSecurity.FileSecurityInstance);
 }
 /// <summary>
 /// Ends an asynchronous write, blocking until the I/O operation has completed.
 /// </summary>
 /// <param name="asyncResult">The pending asynchronous I/O request. </param>
 public void EndWrite(IAsyncResult asyncResult)
 {
     FileStreamInstance.EndWrite(asyncResult);
 }
 /// <inheritdoc />
 public override string ToString()
 {
     return(FileStreamInstance.ToString());
 }
 /// <summary>
 /// Clears all buffers for this stream and causes any buffered data to be written to the file system.
 /// </summary>
 public void Flush()
 {
     FileStreamInstance.Flush();
 }
 /// <inheritdoc />
 public void Unlock(long position, long length)
 {
     FileStreamInstance.Unlock(position, length);
 }
 /// <inheritdoc />
 public IFileSecurityWrap GetAccessControl()
 {
     return(new FileSecurityWrap(FileStreamInstance.GetAccessControl()));
 }
 /// <summary>
 /// Writes a byte to the current position in the file stream.
 /// </summary>
 /// <param name="value">A byte to write to the stream.</param>
 public void WriteByte(byte value)
 {
     FileStreamInstance.WriteByte(value);
 }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 /// <param name="disposing">Indicates whether or not unmanaged resources should be disposed.</param>
 protected virtual void Dispose(bool disposing)
 {
     FileStreamInstance.Dispose();
 }