RawStream Class
Namespace: GHIElectronics.TinyCLR.Devices.UsbClient · Assembly: GHIElectronics.TinyCLR.Devices.UsbClient
USB stream for reading and writing data through two endpoints.
public class RawStream : Stream
Constructors
RawStream(int streamIndex, RawDevice parent)
public RawStream(int streamIndex, RawDevice parent)
No description available.
| Parameter | Type | Description |
|---|---|---|
streamIndex | int | |
parent | RawDevice |
Properties
NullEndpoint
public static int NullEndpoint { get; }
Represents no endpoint.
StreamIndex
public int StreamIndex { get; }
The index of this stream.
ReadTimeout
public override int ReadTimeout { get; set; }
How long to wait before timing out a read operation.
WriteTimeout
public override int WriteTimeout { get; set; }
How long to wait before timing out a write operation.
CanRead
public override bool CanRead { get; }
Whether or not read is allowed from the stream.
CanSeek
public override bool CanSeek { get; }
Whether or not seeking is allowed in the stream.
CanWrite
public override bool CanWrite { get; }
Whether or not writting is allowed to the stream.
Length
public override long Length { get; }
Not supported.
Position
public override long Position { get; set; }
Not supported.
LastWritten
public int LastWritten { get; set; }
The number of bytes successfully written in the last call to any Write function.
BytesToRead
public int BytesToRead { get; }
The number of bytes available to read.
BytesToWrite
public int BytesToWrite { get; }
The number of bytes that are in the process of being written.
Methods
Seek(long offset, SeekOrigin origin)
public override long Seek(long offset, SeekOrigin origin)
Not supported.
| Parameter | Type | Description |
|---|---|---|
offset | long | Not supported. |
origin | SeekOrigin | Not supported. |
Returns long — Not supported.
SetLength(long value)
public override void SetLength(long value)
Not supported.
| Parameter | Type | Description |
|---|---|---|
value | long | Not supported. |
Flush()
public override void Flush()
Flushs the USB write buffers.
Read(byte[] buffer, int offset, int count)
public override int Read(byte[] buffer, int offset, int count)
Reads data from the stream.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer to read into. |
offset | int | The offset into the buffer at which to write the data. |
count | int | The number of bytes to read. |
Returns int — The number of bytes read.
Write(byte[] buffer, int offset, int count)
public override void Write(byte[] buffer, int offset, int count)
Writes data to the stream.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer from which to write. |
offset | int | The offset into the buffer at which to begin writing. |
count | int | The number of bytes to write. |
Read(byte[] buffer)
public int Read(byte[] buffer)
Reads data from the stream.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer into which to read. |
Returns int — The number of bytes read.
Write(byte[] buffer)
public void Write(byte[] buffer)
Writes data to the stream.
| Parameter | Type | Description |
|---|---|---|
buffer | byte[] | The buffer from which to write. |
Dispose(bool disposing)
protected override void Dispose(bool disposing)
Disposes the object.
| Parameter | Type | Description |
|---|---|---|
disposing | bool | Whether or not this is called from Dispose. |