IDataReader IDataReader IDataReader IDataReader IDataReader Interface


Provides read access to an input stream.

public : interface IDataReader
struct winrt::Windows::Storage::Streams::IDataReader
public interface IDataReader
Public Interface IDataReader
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


ByteOrder ByteOrder ByteOrder ByteOrder ByteOrder

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

public : ByteOrder ByteOrder { get; set; }
ByteOrder ByteOrder(); void ByteOrder(ByteOrder byteorder);
public ByteOrder ByteOrder { get; set; }
Public ReadWrite Property ByteOrder As ByteOrder
var byteOrder = iDataReader.byteOrder;
iDataReader.byteOrder = byteOrder;
ByteOrder ByteOrder ByteOrder

One of the enumeration values.

InputStreamOptions InputStreamOptions InputStreamOptions InputStreamOptions InputStreamOptions

Gets or sets the read options for the input stream.

public : InputStreamOptions InputStreamOptions { get; set; }
InputStreamOptions InputStreamOptions(); void InputStreamOptions(InputStreamOptions inputstreamoptions);
public InputStreamOptions InputStreamOptions { get; set; }
Public ReadWrite Property InputStreamOptions As InputStreamOptions
var inputStreamOptions = iDataReader.inputStreamOptions;
iDataReader.inputStreamOptions = inputStreamOptions;
InputStreamOptions InputStreamOptions InputStreamOptions

One of the enumeration values.

UnconsumedBufferLength UnconsumedBufferLength UnconsumedBufferLength UnconsumedBufferLength UnconsumedBufferLength

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

public : unsigned int UnconsumedBufferLength { get; }
uint32_t UnconsumedBufferLength();
public uint UnconsumedBufferLength { get; }
Public ReadOnly Property UnconsumedBufferLength As uint
var uint = iDataReader.unconsumedBufferLength;
uint uint uint

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

UnicodeEncoding UnicodeEncoding UnicodeEncoding UnicodeEncoding UnicodeEncoding

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

public : UnicodeEncoding UnicodeEncoding { get; set; }
UnicodeEncoding UnicodeEncoding(); void UnicodeEncoding(UnicodeEncoding unicodeencoding);
public UnicodeEncoding UnicodeEncoding { get; set; }
Public ReadWrite Property UnicodeEncoding As UnicodeEncoding
var unicodeEncoding = iDataReader.unicodeEncoding;
iDataReader.unicodeEncoding = unicodeEncoding;
UnicodeEncoding UnicodeEncoding UnicodeEncoding

One of the enumeration values.


DetachBuffer() DetachBuffer() DetachBuffer() DetachBuffer() DetachBuffer()

Detaches a buffer that was previously attached to the reader.

public : IBuffer DetachBuffer()
IBuffer DetachBuffer() const;
public IBuffer DetachBuffer()
Public Function DetachBuffer() As IBuffer
var iBuffer = iDataReader.detachBuffer();

The detached buffer.

DetachStream() DetachStream() DetachStream() DetachStream() DetachStream()

Detaches a stream that was previously attached to the reader.

public : IInputStream DetachStream()
IInputStream DetachStream() const;
public IInputStream DetachStream()
Public Function DetachStream() As IInputStream
var iInputStream = iDataReader.detachStream();

The detached stream.

LoadAsync(UInt32) LoadAsync(UInt32) LoadAsync(UInt32) LoadAsync(UInt32) LoadAsync(UInt32)

Loads data from the input stream.

public : DataReaderLoadOperation LoadAsync(unsigned int count)
DataReaderLoadOperation LoadAsync(uint32_t count) const;
public DataReaderLoadOperation LoadAsync(UInt32 count)
Public Function LoadAsync(count As UInt32) As DataReaderLoadOperation
Windows.Storage.Streams.IDataReader.loadAsync(count).done( /* Your success and error handlers */ );
UInt32 UInt32 UInt32

The count of bytes to load into the intermediate buffer.


ReadBoolean() ReadBoolean() ReadBoolean() ReadBoolean() ReadBoolean()

Reads a Boolean value from the input stream.

public : Platform::Boolean ReadBoolean()
bool ReadBoolean() const;
public bool ReadBoolean()
Public Function ReadBoolean() As bool
var bool = iDataReader.readBoolean();
bool bool bool

The value.

ReadBuffer(UInt32) ReadBuffer(UInt32) ReadBuffer(UInt32) ReadBuffer(UInt32) ReadBuffer(UInt32)

Reads a buffer from the input stream.

public : IBuffer ReadBuffer(unsigned int length)
IBuffer ReadBuffer(uint32_t length) const;
public IBuffer ReadBuffer(UInt32 length)
Public Function ReadBuffer(length As UInt32) As IBuffer
var iBuffer = iDataReader.readBuffer(length);
UInt32 UInt32 UInt32

The length of the buffer, in bytes.


The buffer.

ReadByte() ReadByte() ReadByte() ReadByte() ReadByte()

Reads a byte value from the input stream.

public : byte ReadByte()
byte ReadByte() const;
public byte ReadByte()
Public Function ReadByte() As byte
var byte = iDataReader.readByte();
byte byte byte

The value.

ReadBytes(Byte[]) ReadBytes(Byte[]) ReadBytes(Byte[]) ReadBytes(Byte[]) ReadBytes(Byte[])

Reads an array of byte values from the input stream.

public : void ReadBytes(Byte[] value)
void ReadBytes(Byte[] value) const;
public void ReadBytes(Byte[] value)
Public Function ReadBytes(value As Byte[]) As void
Byte[] Byte[] Byte[]

The array of values.

ReadDateTime() ReadDateTime() ReadDateTime() ReadDateTime() ReadDateTime()

Reads a date and time value from the input stream.

public : DateTime ReadDateTime()
DateTime ReadDateTime() const;
public DateTimeOffset ReadDateTime()
Public Function ReadDateTime() As DateTimeOffset
var dateTime = iDataReader.readDateTime();
DateTimeOffset DateTimeOffset DateTimeOffset

The value.

ReadDouble() ReadDouble() ReadDouble() ReadDouble() ReadDouble()

Reads a floating-point value from the input stream.

public : double ReadDouble()
double ReadDouble() const;
public double ReadDouble()
Public Function ReadDouble() As double
var double = iDataReader.readDouble();
double double double

The value.

ReadGuid() ReadGuid() ReadGuid() ReadGuid() ReadGuid()

Reads a GUID value from the input stream.

public : Platform::Guid ReadGuid()
Guid ReadGuid() const;
public Guid ReadGuid()
Public Function ReadGuid() As Guid
var guid = iDataReader.readGuid();
Guid Guid Guid

The value.

ReadInt16() ReadInt16() ReadInt16() ReadInt16() ReadInt16()

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

public : short ReadInt16()
short ReadInt16() const;
public short ReadInt16()
Public Function ReadInt16() As short
var short = iDataReader.readInt16();
short short short

The value.

ReadInt32() ReadInt32() ReadInt32() ReadInt32() ReadInt32()

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

public : int ReadInt32()
int32_t ReadInt32() const;
public int ReadInt32()
Public Function ReadInt32() As int
var int = iDataReader.readInt32();
int int int

The value.

ReadInt64() ReadInt64() ReadInt64() ReadInt64() ReadInt64()

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

public : long ReadInt64()
long ReadInt64() const;
public long ReadInt64()
Public Function ReadInt64() As long
var long = iDataReader.readInt64();
long long long

The value.

ReadSingle() ReadSingle() ReadSingle() ReadSingle() ReadSingle()

Reads a floating-point value from the input stream.

public : float ReadSingle()
float ReadSingle() const;
public float ReadSingle()
Public Function ReadSingle() As float
var float = iDataReader.readSingle();
float float float

The value.

ReadString(UInt32) ReadString(UInt32) ReadString(UInt32) ReadString(UInt32) ReadString(UInt32)

Reads a string value from the input stream.

public : Platform::String ReadString(unsigned int codeUnitCount)
winrt::hstring ReadString(uint32_t codeUnitCount) const;
public string ReadString(UInt32 codeUnitCount)
Public Function ReadString(codeUnitCount As UInt32) As string
var string = iDataReader.readString(codeUnitCount);
UInt32 UInt32 UInt32

The length of the string.

string string string

The value.

ReadTimeSpan() ReadTimeSpan() ReadTimeSpan() ReadTimeSpan() ReadTimeSpan()

Reads a time interval from the input stream.

public : TimeSpan ReadTimeSpan()
TimeSpan ReadTimeSpan() const;
public TimeSpan ReadTimeSpan()
Public Function ReadTimeSpan() As TimeSpan
var timeSpan = iDataReader.readTimeSpan();
TimeSpan TimeSpan TimeSpan

The value.

ReadUInt16() ReadUInt16() ReadUInt16() ReadUInt16() ReadUInt16()

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

public : ushort ReadUInt16()
ushort ReadUInt16() const;
public ushort ReadUInt16()
Public Function ReadUInt16() As ushort
var ushort = iDataReader.readuInt16();
ushort ushort ushort

The value.

ReadUInt32() ReadUInt32() ReadUInt32() ReadUInt32() ReadUInt32()

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

public : unsigned int ReadUInt32()
uint32_t ReadUInt32() const;
public uint ReadUInt32()
Public Function ReadUInt32() As uint
var uint = iDataReader.readuInt32();
uint uint uint

The value.

ReadUInt64() ReadUInt64() ReadUInt64() ReadUInt64() ReadUInt64()

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

public : ulong ReadUInt64()
ulong ReadUInt64() const;
public ulong ReadUInt64()
Public Function ReadUInt64() As ulong
var ulong = iDataReader.readuInt64();
ulong ulong ulong

The value.