Class DataReader
Inherited Members
Namespace: Windows.Storage.Streams
Assembly: Windows.Storage.Streams.dll
Syntax
public sealed class DataReader : MarshalByRefObject, IDisposable, IDataReader
Constructors
| Improve this Doc View SourceDataReader(IInputStream)
Creates and initializes a new instance of the data reader.
Declaration
public DataReader(IInputStream inputStream)
Parameters
Type | Name | Description |
---|---|---|
IInputStream | inputStream | The input stream. |
Properties
| Improve this Doc View SourceByteOrder
Gets or sets the byte order of the data in the input stream.
Declaration
public ByteOrder ByteOrder { get; }
Property Value
Type | Description |
---|---|
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.
Declaration
public InputStreamOptions InputStreamOptions { get; set; }
Property Value
Type | Description |
---|---|
InputStreamOptions | One of the enumeration values. |
UnconsumedBufferLength
Gets the size of the buffer that has not been read.
Declaration
public uint UnconsumedBufferLength { get; }
Property Value
Type | Description |
---|---|
UInt32 | The size of the buffer that has not been read, in bytes. |
UnicodeEncoding
Gets or sets the Unicode character encoding for the input stream.
Declaration
public UnicodeEncoding UnicodeEncoding { get; }
Property Value
Type | Description |
---|---|
UnicodeEncoding | One of the enumeration values. |
Remarks
nanoFramework doesn't this feature. UnicodeEncoding is always Utf8.
Methods
| Improve this Doc View SourceDetachStream()
Detaches a stream that was previously attached to the reader.
Declaration
public IInputStream DetachStream()
Returns
Type | Description |
---|---|
IInputStream | The detached stream. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
FromBuffer(IBuffer)
Creates a new instance of the data reader with data from the specified buffer.
Declaration
public static DataReader FromBuffer(IBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
IBuffer | buffer | The buffer. |
Returns
Type | Description |
---|---|
DataReader | The data reader. |
Load(UInt32)
Loads data from the input stream.
Declaration
public uint Load(uint count)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | count | The count of bytes to load into the intermediate buffer. |
Returns
Type | Description |
---|---|
UInt32 | The operation. |
ReadBoolean()
Reads a Boolean value from the input stream.
Declaration
public bool ReadBoolean()
Returns
Type | Description |
---|---|
Boolean | The value. |
ReadBuffer(UInt32)
Reads a buffer from the input stream.
Declaration
public IBuffer ReadBuffer(uint length)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | length | The length of the buffer, in bytes. |
Returns
Type | Description |
---|---|
IBuffer | The buffer. |
ReadByte()
Reads a byte value from the input stream.
Declaration
public byte ReadByte()
Returns
Type | Description |
---|---|
Byte | The value. |
ReadBytes(Byte[])
Reads an array of byte values from the input stream.
Declaration
public void ReadBytes(byte[] value)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | value | The array of values. |
ReadDateTime()
Reads a date and time value from the input stream.
Declaration
public DateTime ReadDateTime()
Returns
Type | Description |
---|---|
DateTime | The value. |
ReadDouble()
Reads a floating-point value from the input stream.
Declaration
public double ReadDouble()
Returns
Type | Description |
---|---|
Double | The value. |
ReadGuid()
Reads a GUID value from the input stream.
Declaration
public Guid ReadGuid()
Returns
Type | Description |
---|---|
Guid | The value. |
ReadInt16()
Reads a 16-bit integer value from the input stream.
Declaration
public short ReadInt16()
Returns
Type | Description |
---|---|
Int16 | The value. |
ReadInt32()
Reads a 32-bit integer value from the input stream.
Declaration
public int ReadInt32()
Returns
Type | Description |
---|---|
Int32 | The value. |
ReadInt64()
Reads a 64-bit integer value from the input stream.
Declaration
public long ReadInt64()
Returns
Type | Description |
---|---|
Int64 | The value. |
ReadSingle()
Reads a floating-point value from the input stream.
Declaration
public float ReadSingle()
Returns
Type | Description |
---|---|
Single | The value. |
ReadString(UInt32)
Reads a string value from the input stream.
Declaration
public string ReadString(uint codeUnitCount)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | codeUnitCount | The length of the string. |
Returns
Type | Description |
---|---|
String | The value. |
ReadTimeSpan()
Reads a time interval from the input stream.
Declaration
public TimeSpan ReadTimeSpan()
Returns
Type | Description |
---|---|
TimeSpan | The value. |
ReadUInt16()
Reads a 16-bit unsigned integer from the input stream.
Declaration
public ushort ReadUInt16()
Returns
Type | Description |
---|---|
UInt16 | The value. |
ReadUInt32()
Reads a 32-bit unsigned integer from the input stream.
Declaration
public uint ReadUInt32()
Returns
Type | Description |
---|---|
UInt32 | The value. |
ReadUInt64()
Reads a 64-bit unsigned integer from the input stream.
Declaration
public ulong ReadUInt64()
Returns
Type | Description |
---|---|
UInt64 | The value. |