Show / Hide Table of Contents

Class ZitiStream

A representation of a standard System.IO.Stream which utilizes the NetFoundry network

Inheritance
System.Object
System.MarshalByRefObject
System.IO.Stream
ZitiStream
Implements
System.IAsyncDisposable
System.IDisposable
Inherited Members
System.IO.Stream.Null
System.IO.Stream.BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)
System.IO.Stream.Close()
System.IO.Stream.CopyTo(System.IO.Stream)
System.IO.Stream.CopyTo(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.CopyToAsync(System.IO.Stream, System.Threading.CancellationToken)
System.IO.Stream.CreateWaitHandle()
System.IO.Stream.Dispose()
System.IO.Stream.DisposeAsync()
System.IO.Stream.EndRead(System.IAsyncResult)
System.IO.Stream.EndWrite(System.IAsyncResult)
System.IO.Stream.FlushAsync()
System.IO.Stream.FlushAsync(System.Threading.CancellationToken)
System.IO.Stream.ObjectInvariant()
System.IO.Stream.Read(System.Span<System.Byte>)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.ReadAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.ReadAsync(System.Memory<System.Byte>, System.Threading.CancellationToken)
System.IO.Stream.ReadByte()
System.IO.Stream.Synchronized(System.IO.Stream)
System.IO.Stream.Write(System.ReadOnlySpan<System.Byte>)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32)
System.IO.Stream.WriteAsync(System.Byte[], System.Int32, System.Int32, System.Threading.CancellationToken)
System.IO.Stream.WriteAsync(System.ReadOnlyMemory<System.Byte>, System.Threading.CancellationToken)
System.IO.Stream.WriteByte(System.Byte)
System.IO.Stream.CanTimeout
System.IO.Stream.ReadTimeout
System.IO.Stream.WriteTimeout
System.MarshalByRefObject.GetLifetimeService()
System.MarshalByRefObject.InitializeLifetimeService()
System.MarshalByRefObject.MemberwiseClone(System.Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OpenZiti
Assembly: Ziti.NET.Standard.dll
Syntax
public class ZitiStream : Stream, IAsyncDisposable, IDisposable

Constructors

| Improve this Doc View Source

ZitiStream(ZitiConnection)

Creates a ZitiStream from the provided ZitiConnection

Declaration
public ZitiStream(ZitiConnection conn)
Parameters
Type Name Description
ZitiConnection conn

The ZitiConnection to create a ZitiStream from

Properties

| Improve this Doc View Source

CanRead

Indicates if the stream can be read from

Declaration
public override bool CanRead { get; }
Property Value
Type Description
System.Boolean
Overrides
System.IO.Stream.CanRead
| Improve this Doc View Source

CanSeek

Seeking is not supported

Declaration
public override bool CanSeek { get; }
Property Value
Type Description
System.Boolean
Overrides
System.IO.Stream.CanSeek
| Improve this Doc View Source

CanWrite

indicates if the stream is ready for writing

Declaration
public override bool CanWrite { get; }
Property Value
Type Description
System.Boolean
Overrides
System.IO.Stream.CanWrite
| Improve this Doc View Source

Length

unsupported - always returns 0

Declaration
public override long Length { get; }
Property Value
Type Description
System.Int64
Overrides
System.IO.Stream.Length
| Improve this Doc View Source

Position

unsupported - always returns 0

Declaration
public override long Position { get; set; }
Property Value
Type Description
System.Int64
Overrides
System.IO.Stream.Position
Exceptions
Type Condition
System.NotImplementedException

Thrown when calling set

Methods

| Improve this Doc View Source

Dispose(Boolean)

Disposes of the ZitiStream, cleaning up any retained resources

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing
Overrides
System.IO.Stream.Dispose(System.Boolean)
| Improve this Doc View Source

Flush()

Flushes bytes

Declaration
public override void Flush()
Overrides
System.IO.Stream.Flush()
| Improve this Doc View Source

PumpAsync(Stream)

Asynchronously pumps this ZitiStream to/from the destination System.IO.Stream

Declaration
public async Task PumpAsync(Stream destination)
Parameters
Type Name Description
System.IO.Stream destination
Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

PumpAsync(Stream, Stream)

Asynchronously pumps data between the input System.IO.Stream and destination System.IO.Stream

Declaration
public static async Task PumpAsync(Stream input, Stream destination)
Parameters
Type Name Description
System.IO.Stream input

The input stream

System.IO.Stream destination

The destination stream

Returns
Type Description
System.Threading.Tasks.Task

A System.Threading.Tasks.Task which is awaitable

| Improve this Doc View Source

Read(Byte[], Int32, Int32)

Reads data into the provided buffer

Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to read data into

System.Int32 offset

The position in the bufer to begin appending data

System.Int32 count

The number of bytes to append

Returns
Type Description
System.Int32

Returns the number of bytes read

Overrides
System.IO.Stream.Read(System.Byte[], System.Int32, System.Int32)
Exceptions
Type Condition
System.NotSupportedException

Thrown if the stream is not ready for reading

System.ArgumentNullException

Thrown if the buffer provided is null

System.ArgumentException

Thrown if the offset and count provided is larger than the buffer provided

System.ArgumentOutOfRangeException

Thrown if the offset or count provided is less than 0

| Improve this Doc View Source

Seek(Int64, SeekOrigin)

unsupported

Declaration
public override long Seek(long offset, SeekOrigin origin)
Parameters
Type Name Description
System.Int64 offset
System.IO.SeekOrigin origin
Returns
Type Description
System.Int64
Overrides
System.IO.Stream.Seek(System.Int64, System.IO.SeekOrigin)
| Improve this Doc View Source

SetLength(Int64)

unsupported

Declaration
public override void SetLength(long value)
Parameters
Type Name Description
System.Int64 value
Overrides
System.IO.Stream.SetLength(System.Int64)
| Improve this Doc View Source

Write(Byte[], Int32, Int32)

Writes the provided buffer over the ZitiNetwork

Declaration
public override void Write(byte[] buffer, int offset, int count)
Parameters
Type Name Description
System.Byte[] buffer

The buffer containing data to write

System.Int32 offset

The position in the buffer to read from

System.Int32 count

The number of bytes to write from the buffer

Overrides
System.IO.Stream.Write(System.Byte[], System.Int32, System.Int32)
Exceptions
Type Condition
System.NotSupportedException

Thrown if the stream is not ready for writing

System.ArgumentNullException

Thrown if the buffer provided is null

System.ArgumentException

Thrown if the offset and count provided is larger than the buffer provided

System.ArgumentOutOfRangeException

Thrown if the offset or count provided is less than 0

Implements

System.IAsyncDisposable
System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX