Class ZitiStream
A representation of a standard System.IO.Stream which utilizes the NetFoundry network
Inheritance
Implements
Inherited Members
Namespace: OpenZiti
Assembly: Ziti.NET.Standard.dll
Syntax
public class ZitiStream : Stream, IAsyncDisposable, IDisposable
Constructors
| Improve this Doc View SourceZitiStream(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 SourceCanRead
Indicates if the stream can be read from
Declaration
public override bool CanRead { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
CanSeek
Seeking is not supported
Declaration
public override bool CanSeek { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
CanWrite
indicates if the stream is ready for writing
Declaration
public override bool CanWrite { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Length
unsupported - always returns 0
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
Position
unsupported - always returns 0
Declaration
public override long Position { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown when calling set |
Methods
| Improve this Doc View SourceDispose(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
Flush()
Flushes bytes
Declaration
public override void Flush()
Overrides
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 |
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 |
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
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 |
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
SetLength(Int64)
unsupported
Declaration
public override void SetLength(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value |
Overrides
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
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 |