Inherits: Stream
Description
This class is used for buffered read/write to other stream.
Important points
- This class is used at least in FieldComm for reading/writing messages to the NetworkStream.
- This class is a port for .Net Compact Framework from System.IO.BufferedStream (Full .Net Framework).
Constructors
Creates a new instance of this class.
publicBufferStream(Stream stream)
- stream: Stream - stream
publicBufferStream(Stream stream, int bufferSize)
- stream: Stream - stream
- bufferSize: int - buffer size
Properties
CanRead
Can read option.
public overridebool CanRead { get; }
CanSeek
Can seek option.
public overridebool CanSeek { get; }
CanWrite
Can write option.
public overridebool CanWrite { get; }
Length
Length
public overridelong Length { get; }
Position
Position
public overridelong Position { get; set; }
Instance methods
Flush
Flushes the stream.
public overridevoid Flush()
Read
Reads from a stream.
public overrideint Read(byte[] array, int offset, int count)
- array: byte[] - array
- offset: int - offset value
- count: int - count value
- returns: int - position
ReadByte
Read from a stream
public overrideint ReadByte()
- returns: int - position
Seek
Seeks within a stream.
public overridelong Seek(long offset, SeekOrigin origin)
- offset: long - offset value
- origin: SeekOrigin - origin
- returns: long - position
SetLength
Sets the length.
public overridevoid SetLength(long value)
- value: long - length value
Write
Writes to a stream.
public overridevoid Write(byte[] array, int offset, int count)
- array: byte[] - array
- offset: int - offset value
- count: int - count
WriteByte
Write bytes to a stream.
public overridevoid WriteByte(byte value)
- value: byte - value