UsbStream Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a USB stream.

Inheritance Hierarchy

System. . :: . .Object
  System. . :: . .MarshalByRefObject
    System.IO. . :: . .Stream
      Microsoft.SPOT.Hardware.UsbClient..::..UsbStream

Namespace:  Microsoft.SPOT.Hardware.UsbClient
Assembly:  Microsoft.SPOT.Hardware.Usb (in Microsoft.SPOT.Hardware.Usb.dll)

Syntax

'Declaration
Public NotInheritable Class UsbStream _
    Inherits Stream
public sealed class UsbStream : Stream
public ref class UsbStream sealed : public Stream
[<Sealed>]
type UsbStream =  
    class
        inherit Stream
    end
public final class UsbStream extends Stream

The UsbStream type exposes the following members.

Properties

  Name Description
Public property CanRead Gets a value indicating whether the current stream supports reading. (Overrides Stream. . :: . .CanRead.)
Public property CanSeek Gets a value indicating whether the current stream supports seeking. (Overrides Stream. . :: . .CanSeek.)
Public property CanTimeout Gets a value that determines whether the current stream can time out. (Inherited from Stream.)
Public property CanWrite Gets a value indicating whether the current stream supports writing. (Overrides Stream. . :: . .CanWrite.)
Public property Length Gets the length in bytes of the stream. (Overrides Stream. . :: . .Length.)
Public property Position Gets or sets the position within the current stream. (Overrides Stream. . :: . .Position.)
Public property ReadTimeout Gets or sets a value, in milliseconds, that determines how long the stream will attempt to read before timing out. (Inherited from Stream.)
Public property WriteTimeout Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. (Inherited from Stream.)

Top

Methods

  Name Description
Public method Close Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed. (Inherited from Stream.)
Public method Dispose() () () () Releases all resources used by the Stream. (Inherited from Stream.)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method Flush Flushes the USB stream, causing its buffer to empty. (Overrides Stream. . :: . .Flush() () () ().)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Read Reads from a USB stream. (Overrides Stream. . :: . .Read(array<Byte> [] () [] [], Int32, Int32).)
Public method ReadByte Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream. (Inherited from Stream.)
Public method Seek Sets the current position of this stream to the given value. (Overrides Stream. . :: . .Seek(Int64, SeekOrigin).)
Public method SetLength Sets the length of this stream to the given value. (Overrides Stream. . :: . .SetLength(Int64).)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Write Writes to a USB stream. (Overrides Stream. . :: . .Write(array<Byte> [] () [] [], Int32, Int32).)
Public method WriteByte Writes a byte to the current position in the stream and advances the position within the stream by one byte. (Inherited from Stream.)

Top

Fields

  Name Description
Public fieldStatic member NullEndpoint Defines a USB stream as having a null endpoint.
Public field ReadEndpoint Defines a USB stream as having a readable endpoint.
Public field WriteEndpoint Defines a USB stream as having a writeable endpoint.

Top

Remarks

Use the CreateUsbStream method to create a UsbStream for a controller.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SPOT.Hardware.UsbClient Namespace