IDataReader IDataReader IDataReader IDataReader Interface

Provides read access to an input stream.

Syntax

Declaration

public interface IDataReaderpublic interface IDataReaderPublic Interface IDataReader

Properties summary

Gets or sets the byte order of the data in the input stream.

Gets or sets the read options for the input stream.

Gets the size of the buffer that has not been read.

Gets or sets the Unicode character encoding for the input stream.

Methods summary

Detaches a buffer that was previously attached to the reader.

Detaches a stream that was previously attached to the reader.

Loads data from the input stream.

Reads a Boolean value from the input stream.

Reads a buffer from the input stream.

Reads a byte value from the input stream.

Reads an array of byte values from the input stream.

Reads a date and time value from the input stream.

Reads a floating-point value from the input stream.

Reads a GUID value from the input stream.

Reads a 16-bit integer value from the input stream.

Reads a 32-bit integer value from the input stream.

Reads a 64-bit integer value from the input stream.

Reads a floating-point value from the input stream.

Reads a string value from the input stream.

Reads a time interval from the input stream.

Reads a 16-bit unsigned integer from the input stream.

Reads a 32-bit unsigned integer from the input stream.

Reads a 64-bit unsigned integer from the input stream.

Properties

  • ByteOrder
    ByteOrder
    ByteOrder
    ByteOrder

    Gets or sets the byte order of the data in the input stream.

    public ByteOrder ByteOrder { get; set; }public ByteOrder ByteOrder { get; set; }Public ReadWrite Property ByteOrder As ByteOrder

    Property Value

  • InputStreamOptions
    InputStreamOptions
    InputStreamOptions
    InputStreamOptions

    Gets or sets the read options for the input stream.

    public InputStreamOptions InputStreamOptions { get; set; }public InputStreamOptions InputStreamOptions { get; set; }Public ReadWrite Property InputStreamOptions As InputStreamOptions

    Property Value

  • UnconsumedBufferLength
    UnconsumedBufferLength
    UnconsumedBufferLength
    UnconsumedBufferLength

    Gets the size of the buffer that has not been read.

    public uint UnconsumedBufferLength { get; }public uint UnconsumedBufferLength { get; }Public ReadOnly Property UnconsumedBufferLength As uint

    Property Value

    • uint
      uint
      uint
      uint

      The size of the buffer that has not been read, in bytes.

  • UnicodeEncoding
    UnicodeEncoding
    UnicodeEncoding
    UnicodeEncoding

    Gets or sets the Unicode character encoding for the input stream.

    public UnicodeEncoding UnicodeEncoding { get; set; }public UnicodeEncoding UnicodeEncoding { get; set; }Public ReadWrite Property UnicodeEncoding As UnicodeEncoding

    Property Value

Methods

  • DetachBuffer()
    DetachBuffer()
    DetachBuffer()
    DetachBuffer()

    Detaches a buffer that was previously attached to the reader.

    public IBuffer DetachBuffer()public IBuffer DetachBuffer()Public Function DetachBuffer() As IBuffer

    Returns

  • DetachStream()
    DetachStream()
    DetachStream()
    DetachStream()

    Detaches a stream that was previously attached to the reader.

    public IInputStream DetachStream()public IInputStream DetachStream()Public Function DetachStream() As IInputStream

    Returns

  • LoadAsync(System.UInt32)
    LoadAsync(System.UInt32)
    LoadAsync(System.UInt32)
    LoadAsync(System.UInt32)

    Loads data from the input stream.

    public DataReaderLoadOperation LoadAsync(System.UInt32)public DataReaderLoadOperation LoadAsync(System.UInt32)Public Function LoadAsync(System.UInt32) As DataReaderLoadOperation

    Parameters

    • count
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The count of bytes to load into the intermediate buffer.

    Returns

  • ReadBoolean()
    ReadBoolean()
    ReadBoolean()
    ReadBoolean()

    Reads a Boolean value from the input stream.

    public bool ReadBoolean()public bool ReadBoolean()Public Function ReadBoolean() As bool

    Returns

    • bool
      bool
      bool
      bool

      The value.

  • ReadBuffer(System.UInt32)
    ReadBuffer(System.UInt32)
    ReadBuffer(System.UInt32)
    ReadBuffer(System.UInt32)

    Reads a buffer from the input stream.

    public IBuffer ReadBuffer(System.UInt32)public IBuffer ReadBuffer(System.UInt32)Public Function ReadBuffer(System.UInt32) As IBuffer

    Parameters

    • length
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The length of the buffer, in bytes.

    Returns

  • ReadByte()
    ReadByte()
    ReadByte()
    ReadByte()

    Reads a byte value from the input stream.

    public byte ReadByte()public byte ReadByte()Public Function ReadByte() As byte

    Returns

    • byte
      byte
      byte
      byte

      The value.

  • ReadBytes(System.Byte[])
    ReadBytes(System.Byte[])
    ReadBytes(System.Byte[])
    ReadBytes(System.Byte[])

    Reads an array of byte values from the input stream.

    public void ReadBytes(System.Byte[])public void ReadBytes(System.Byte[])Public Function ReadBytes(System.Byte[]) As void

    Parameters

    • value
      System.Byte[]
      System.Byte[]
      System.Byte[]
      System.Byte[]

      The array of values.

  • ReadDateTime()
    ReadDateTime()
    ReadDateTime()
    ReadDateTime()

    Reads a date and time value from the input stream.

    public DateTime ReadDateTime()public DateTime ReadDateTime()Public Function ReadDateTime() As DateTime

    Returns

  • ReadDouble()
    ReadDouble()
    ReadDouble()
    ReadDouble()

    Reads a floating-point value from the input stream.

    public double ReadDouble()public double ReadDouble()Public Function ReadDouble() As double

    Returns

    • double
      double
      double
      double

      The value.

  • ReadGuid()
    ReadGuid()
    ReadGuid()
    ReadGuid()

    Reads a GUID value from the input stream.

    public Guid ReadGuid()public Guid ReadGuid()Public Function ReadGuid() As Guid

    Returns

    • System.Guid
      System.Guid
      System.Guid
      System.Guid

      The value.

  • ReadInt16()
    ReadInt16()
    ReadInt16()
    ReadInt16()

    Reads a 16-bit integer value from the input stream.

    public short ReadInt16()public short ReadInt16()Public Function ReadInt16() As short

    Returns

    • short
      short
      short
      short

      The value.

  • ReadInt32()
    ReadInt32()
    ReadInt32()
    ReadInt32()

    Reads a 32-bit integer value from the input stream.

    public int ReadInt32()public int ReadInt32()Public Function ReadInt32() As int

    Returns

    • int
      int
      int
      int

      The value.

  • ReadInt64()
    ReadInt64()
    ReadInt64()
    ReadInt64()

    Reads a 64-bit integer value from the input stream.

    public long ReadInt64()public long ReadInt64()Public Function ReadInt64() As long

    Returns

    • long
      long
      long
      long

      The value.

  • ReadSingle()
    ReadSingle()
    ReadSingle()
    ReadSingle()

    Reads a floating-point value from the input stream.

    public float ReadSingle()public float ReadSingle()Public Function ReadSingle() As float

    Returns

    • float
      float
      float
      float

      The value.

  • ReadString(System.UInt32)
    ReadString(System.UInt32)
    ReadString(System.UInt32)
    ReadString(System.UInt32)

    Reads a string value from the input stream.

    public string ReadString(System.UInt32)public string ReadString(System.UInt32)Public Function ReadString(System.UInt32) As string

    Parameters

    • codeUnitCount
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The length of the string.

    Returns

    • string
      string
      string
      string

      The value.

  • ReadTimeSpan()
    ReadTimeSpan()
    ReadTimeSpan()
    ReadTimeSpan()

    Reads a time interval from the input stream.

    public TimeSpan ReadTimeSpan()public TimeSpan ReadTimeSpan()Public Function ReadTimeSpan() As TimeSpan

    Returns

  • ReadUInt16()
    ReadUInt16()
    ReadUInt16()
    ReadUInt16()

    Reads a 16-bit unsigned integer from the input stream.

    public ushort ReadUInt16()public ushort ReadUInt16()Public Function ReadUInt16() As ushort

    Returns

    • ushort
      ushort
      ushort
      ushort

      The value.

  • ReadUInt32()
    ReadUInt32()
    ReadUInt32()
    ReadUInt32()

    Reads a 32-bit unsigned integer from the input stream.

    public uint ReadUInt32()public uint ReadUInt32()Public Function ReadUInt32() As uint

    Returns

    • uint
      uint
      uint
      uint

      The value.

  • ReadUInt64()
    ReadUInt64()
    ReadUInt64()
    ReadUInt64()

    Reads a 64-bit unsigned integer from the input stream.

    public ulong ReadUInt64()public ulong ReadUInt64()Public Function ReadUInt64() As ulong

    Returns

    • ulong
      ulong
      ulong
      ulong

      The value.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.Storage.Streams.dll