Skip to main content

FtpResponseStream Class

Namespace: GHIElectronics.TinyCLR.Networking · Assembly: GHIElectronics.TinyCLR.Networking.Ftp

A virtual stream to do the read / write job from / to sockets

public class FtpResponseStream : Stream

Constructors

FtpResponseStream(FtpListenerResponse responese)

public FtpResponseStream(FtpListenerResponse responese)

No description available.

ParameterTypeDescription
responeseFtpListenerResponse

FtpResponseStream(FtpListenerResponse responese, Stream stream)

public FtpResponseStream(FtpListenerResponse responese, Stream stream) : this(responese)

No description available.

ParameterTypeDescription
responeseFtpListenerResponse
streamStream

Properties

CanRead

public override bool CanRead { get; }

Gets a value indicating whether the current stream supports reading. (inherited)

CanSeek

public override bool CanSeek { get; }

Gets a value indicating whether the current stream supports seeking. (inherited)

CanWrite

public override bool CanWrite { get; }

Gets a value indicating whether the current stream supports writing. (inherited)

Length

public override long Length { get; }

Gets length of bytes in the stream. (inherited)

Position

public override long Position { get; set; }

Gets or sets the current possition in the stream. (inherited)

Methods

Flush()

public override void Flush()

Writes unwritten data to the file. (inherited)

Close()

public override void Close()

When overridden by a descendant class, closes the response stream. (inherited)

Read(byte[] buffer, int offset, int count)

public override int Read(byte[] buffer, int offset, int count)

Reads a block of bytes from the stream. (inherited)

ParameterTypeDescription
bufferbyte[]
offsetintThe byte offset in the array at which read bytes will be placed.
countintThe maximun number of bytes to read.

Returns int

Seek(long offset, SeekOrigin origin)

public override long Seek(long offset, SeekOrigin origin)

Sets the current position of this stream to a given value. (inherited)

ParameterTypeDescription
offsetlongThe offset of the positon relative to the origin.
originSeekOriginSpecified the beginning, end or current postion as a reference point to apply the offset.

Returns long — The new postion in the stream.

SetLength(long value)

public override void SetLength(long value)

Adjusts the length of the array. This can be used to trim the end of the array. (inherited)

ParameterTypeDescription
valuelong

Write(byte[] buffer, int offset, int count)

public override void Write(byte[] buffer, int offset, int count)

Writes a block of bytes to the file stream. (inherited)

ParameterTypeDescription
bufferbyte[]
offsetintThe byte offset in the array from which to start writing bytes to the stream.
countintThe number of bytes to write.

Write(string s)

public void Write(string s)

Write a string to the buffer

ParameterTypeDescription
sstring

Write(FileStream stream)

public void Write(FileStream stream)

Read data from the stream and write them to the socket

ParameterTypeDescription
streamFileStream

ReadTo(FileStream stream)

public void ReadTo(FileStream stream)

Read data the file stream provided in the paramenter

ParameterTypeDescription
streamFileStream

Write(FileSystemInfo info)

public void Write(FileSystemInfo info)

Write a fileinfo or directoryinfo to the socket

ParameterTypeDescription
infoFileSystemInfo

Read(out string s)

public int Read(out string s)

Read the data from internal buffer

ParameterTypeDescription
sout string

Returns int