Skip to main content

FtpResponseStream Class

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

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

public class FtpResponseStream : Stream

Constructors

FtpResponseStream(FtpListenerResponse responese)

public FtpResponseStream(FtpListenerResponse responese)

Creates a response stream associated with the given response.

FtpResponseStream(FtpListenerResponse responese, Stream stream)

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

Creates a response stream that reads from or writes to the given underlying stream.

Properties

CanRead

public override bool CanRead { get; }

Gets a value indicating whether the stream supports reading; always false.

CanSeek

public override bool CanSeek { get; }

Gets a value indicating whether the stream supports seeking; always false.

CanWrite

public override bool CanWrite { get; }

Gets a value indicating whether the stream supports writing; always true.

Length

public override long Length { get; }

Gets the number of bytes currently held in the internal buffer.

Position

public override long Position { get; set; }

Getting or setting the position is not supported by this stream.

Methods

Flush()

public override void Flush()

Flushes the stream; this implementation does nothing.

Close()

public override void Close()

Closes the stream and sends the pending FTP response.

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

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

Reading bytes from this stream is not supported.

Returns int

Seek(long offset, SeekOrigin origin)

public override long Seek(long offset, SeekOrigin origin)

Seeking is not supported by this stream.

Returns long

SetLength(long value)

public override void SetLength(long value)

Setting the length is not supported by this stream.

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

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

Writing a byte buffer is not supported by this stream.

Write(string s)

public void Write(string s)

Write a string to the buffer

Write(FileStream stream)

public void Write(FileStream stream)

Read data from the stream and write them to the socket

ReadTo(FileStream stream)

public void ReadTo(FileStream stream)

Read data the file stream provided in the paramenter

Write(FileSystemInfo info)

public void Write(FileSystemInfo info)

Write a fileinfo or directoryinfo to the socket

Read(out string s)

public int Read(out string s)

Read the data from internal buffer

Returns int