예제 #1
0
 /// <summary>
 /// Sets the position within the current stream to the specified value.
 /// </summary>
 /// <param name="offset">The new position within the stream. This is relative to the loc parameter, and can be positive or negative. </param>
 /// <param name="origin">A value of type SeekOrigin, which acts as the seek reference point. </param>
 /// <returns>The new position within the stream, calculated by combining the initial reference point and the offset.</returns>
 public long Seek(long offset, SeekOrigin origin)
 {
     return(MemoryStreamInstance.Seek(offset, origin));
 }
예제 #2
0
 /// <summary>
 /// Sets the length of the current stream to the specified value.
 /// </summary>
 /// <param name="value">The value at which to set the length.</param>
 public void SetLength(long value)
 {
     MemoryStreamInstance.SetLength(value);
 }
예제 #3
0
 /// <summary>
 /// Reads a block of bytes from the current stream and writes the data to 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 characters read from the current stream. </param>
 /// <param name="offset">The byte offset in buffer at which to begin reading.</param>
 /// <param name="count">The maximum number of bytes to read. </param>
 /// <returns>The total number of bytes written into the buffer. This can 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 before any bytes are read. </returns>
 public int Read(byte[] buffer, int offset, int count)
 {
     return(MemoryStreamInstance.Read(buffer, offset, count));
 }
예제 #4
0
 /// <summary>
 /// Reads a byte from the current stream.
 /// </summary>
 /// <returns>The byte cast to a Int32, or -1 if the end of the stream has been reached.</returns>
 public int ReadByte()
 {
     return(MemoryStreamInstance.ReadByte());
 }
예제 #5
0
 /// <inheritdoc />
 public void WriteTo(IStream stream)
 {
     MemoryStreamInstance.WriteTo(stream.StreamInstance);
 }
예제 #6
0
 public async Task FlushAsync()
 {
     await MemoryStreamInstance.FlushAsync();
 }
예제 #7
0
 /// <inheritdoc />
 public virtual void Close()
 {
     MemoryStreamInstance.Close();
 }
예제 #8
0
 /// <inheritdoc />
 public byte[] GetBuffer()
 {
     return(MemoryStreamInstance.GetBuffer());
 }
예제 #9
0
 public async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 {
     await MemoryStreamInstance.WriteAsync(buffer, offset, count, cancellationToken);
 }
예제 #10
0
 public IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 {
     return(MemoryStreamInstance.BeginWrite(buffer, offset, count, callback, state));
 }
예제 #11
0
 public async Task WriteAsync(byte[] buffer, int offset, int count)
 {
     await MemoryStreamInstance.WriteAsync(buffer, offset, count);
 }
예제 #12
0
 public async Task <int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
 {
     return(await MemoryStreamInstance.ReadAsync(buffer, offset, count, cancellationToken));
 }
예제 #13
0
 public async Task <int> ReadAsync(byte[] buffer, int offset, int count)
 {
     return(await MemoryStreamInstance.ReadAsync(buffer, offset, count));
 }
예제 #14
0
 /// <summary>
 /// Writes a block of bytes to the current stream using data read from buffer.
 /// </summary>
 /// <param name="buffer">The buffer to write data from. </param>
 /// <param name="offset">The byte offset in buffer at which to begin writing from. </param>
 /// <param name="count">The maximum number of bytes to write. </param>
 public void Write(byte[] buffer, int offset, int count)
 {
     MemoryStreamInstance.Write(buffer, offset, count);
 }
예제 #15
0
 /// <inheritdoc />
 public int EndRead(IAsyncResult asyncResult)
 {
     return(MemoryStreamInstance.EndRead(asyncResult));
 }
예제 #16
0
 /// <summary>
 /// Writes a byte to the current stream at the current position.
 /// </summary>
 /// <param name="value">The byte to write. </param>
 public void WriteByte(byte value)
 {
     MemoryStreamInstance.WriteByte(value);
 }
예제 #17
0
 /// <inheritdoc />
 public void EndWrite(IAsyncResult asyncResult)
 {
     MemoryStreamInstance.EndWrite(asyncResult);
 }
예제 #18
0
 /// <inheritdoc />
 public byte[] ToArray()
 {
     return(MemoryStreamInstance.ToArray());
 }
예제 #19
0
 /// <summary>
 /// Overrides Stream.Flush so that no action is performed.
 /// </summary>
 public void Flush()
 {
     MemoryStreamInstance.Flush();
 }
예제 #20
0
 /// <inheritdoc />
 public void Dispose()
 {
     MemoryStreamInstance.Dispose();
 }
예제 #21
0
 /// <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)
 {
     MemoryStreamInstance.Dispose();
 }