Table of Contents

Class DataReader

Namespace
Windows.Storage.Streams
Assembly
Windows.Storage.Streams.dll
public sealed class DataReader : MarshalByRefObject, IDisposable, IDataReader
Inheritance
DataReader
Implements
Inherited Members
Extension Methods

Constructors

DataReader(IInputStream)

Creates and initializes a new instance of the data reader.

public DataReader(IInputStream inputStream)

Parameters

inputStream IInputStream

The input stream.

Properties

ByteOrder

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

public ByteOrder ByteOrder { get; }

Property Value

ByteOrder

One of the enumeration values.

Remarks

nanoFramework doesn't this feature. ByteOrder is always LittleEndian.

InputStreamOptions

Gets or sets the read options for the input stream.

public InputStreamOptions InputStreamOptions { get; set; }

Property Value

InputStreamOptions

One of the enumeration values.

UnconsumedBufferLength

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

public uint UnconsumedBufferLength { get; }

Property Value

uint

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

UnicodeEncoding

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

public UnicodeEncoding UnicodeEncoding { get; }

Property Value

UnicodeEncoding

One of the enumeration values.

Remarks

nanoFramework doesn't this feature. UnicodeEncoding is always Utf8.

Methods

DetachStream()

Detaches a stream that was previously attached to the reader.

public IInputStream DetachStream()

Returns

IInputStream

The detached stream.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FromBuffer(IBuffer)

Creates a new instance of the data reader with data from the specified buffer.

public static DataReader FromBuffer(IBuffer buffer)

Parameters

buffer IBuffer

The buffer.

Returns

DataReader

The data reader.

Load(uint)

Loads data from the input stream.

public uint Load(uint count)

Parameters

count uint

The count of bytes to load into the intermediate buffer.

Returns

uint

The operation.

ReadBoolean()

Reads a Boolean value from the input stream.

public bool ReadBoolean()

Returns

bool

The value.

ReadBuffer(uint)

Reads a buffer from the input stream.

public IBuffer ReadBuffer(uint length)

Parameters

length uint

The length of the buffer, in bytes.

Returns

IBuffer

The buffer.

ReadByte()

Reads a byte value from the input stream.

public byte ReadByte()

Returns

byte

The value.

ReadBytes(byte[])

Reads an array of byte values from the input stream.

public void ReadBytes(byte[] value)

Parameters

value byte[]

The array of values.

ReadDateTime()

Reads a date and time value from the input stream.

public DateTime ReadDateTime()

Returns

DateTime

The value.

ReadDouble()

Reads a floating-point value from the input stream.

public double ReadDouble()

Returns

double

The value.

ReadGuid()

Reads a GUID value from the input stream.

public Guid ReadGuid()

Returns

Guid

The value.

ReadInt16()

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

public short ReadInt16()

Returns

short

The value.

ReadInt32()

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

public int ReadInt32()

Returns

int

The value.

ReadInt64()

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

public long ReadInt64()

Returns

long

The value.

ReadSingle()

Reads a floating-point value from the input stream.

public float ReadSingle()

Returns

float

The value.

ReadString(uint)

Reads a string value from the input stream.

public string ReadString(uint codeUnitCount)

Parameters

codeUnitCount uint

The length of the string.

Returns

string

The value.

ReadTimeSpan()

Reads a time interval from the input stream.

public TimeSpan ReadTimeSpan()

Returns

TimeSpan

The value.

ReadUInt16()

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

public ushort ReadUInt16()

Returns

ushort

The value.

ReadUInt32()

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

public uint ReadUInt32()

Returns

uint

The value.

ReadUInt64()

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

public ulong ReadUInt64()

Returns

ulong

The value.