IDataWriter IDataWriter IDataWriter IDataWriter Interface

Definition

Provides write access to an output stream.

public : interface IDataWriterpublic interface IDataWriterPublic Interface IDataWriter// You can use this interface in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

ByteOrder ByteOrder ByteOrder ByteOrder

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

public : ByteOrder ByteOrder { get; set; }public ByteOrder ByteOrder { get; set; }Public ReadWrite Property ByteOrder As ByteOrder// You can use this property in JavaScript.
Value
ByteOrder ByteOrder ByteOrder ByteOrder

One of the enumeration values.

UnicodeEncoding UnicodeEncoding UnicodeEncoding UnicodeEncoding

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

public : UnicodeEncoding UnicodeEncoding { get; set; }public UnicodeEncoding UnicodeEncoding { get; set; }Public ReadWrite Property UnicodeEncoding As UnicodeEncoding// You can use this property in JavaScript.
Value
UnicodeEncoding UnicodeEncoding UnicodeEncoding UnicodeEncoding

One of the enumeration values.

UnstoredBufferLength UnstoredBufferLength UnstoredBufferLength UnstoredBufferLength

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

public : unsigned int UnstoredBufferLength { get; }public uint UnstoredBufferLength { get; }Public ReadOnly Property UnstoredBufferLength As uint// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The available buffer length, in bytes.

Methods

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

Detaches a buffer that was previously attached to the writer.

public : IBuffer DetachBuffer()public IBuffer DetachBuffer()Public Function DetachBuffer() As IBuffer// You can use this method in JavaScript.
Returns

The detached buffer.

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

Detaches a stream that was previously attached to the writer.

public : IOutputStream DetachStream()public IOutputStream DetachStream()Public Function DetachStream() As IOutputStream// You can use this method in JavaScript.
Returns

FlushAsync() FlushAsync() FlushAsync() FlushAsync()

Flushes data asynchronously.

public : IAsyncOperation<PlatForm::Boolean> FlushAsync()public IAsyncOperation<bool> FlushAsync()Public Function FlushAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
Returns

The stream flush operation.

Remarks

The FlushAsync method ensures that the data has reached the target storage medium that the stream represents. For example, to improve application responsiveness and throughput, a file stream might respond to a write operation by copying the buffer into another temporary storage medium and returning immediately, while the target device begins writing the data concurrently.

The FlushAsync method doesn't complete until all data specified in previous write calls has reached the target storage medium. If the data can't be written, or an error occurred during a write operation, the method returns false.

The FlushAsync method may produce latencies and does not always guarantee durable and coherent storage of data. It's generally recommended to avoid this method if possible.

MeasureString(String) MeasureString(String) MeasureString(String) MeasureString(String)

Gets the size of a string.

public : unsigned int MeasureString(PlatForm::String value)public uint MeasureString(String value)Public Function MeasureString(value As String) As uint// You can use this method in JavaScript.
Parameters
value
PlatForm::String String String String

The string.

Returns
unsigned int uint uint uint

The size of the string, in bytes.

StoreAsync() StoreAsync() StoreAsync() StoreAsync()

Commits data in the buffer to a backing store.

public : DataWriterStoreOperation StoreAsync()public DataWriterStoreOperation StoreAsync()Public Function StoreAsync() As DataWriterStoreOperation// You can use this method in JavaScript.
Returns

WriteBoolean(Boolean) WriteBoolean(Boolean) WriteBoolean(Boolean) WriteBoolean(Boolean)

Writes a Boolean value to the output stream.

public : void WriteBoolean(bool value)public void WriteBoolean(Boolean value)Public Function WriteBoolean(value As Boolean) As void// You can use this method in JavaScript.
Parameters
value
bool Boolean Boolean Boolean

The value.

WriteBuffer(IBuffer) WriteBuffer(IBuffer) WriteBuffer(IBuffer) WriteBuffer(IBuffer)

Writes a number of bytes from a buffer to the output stream.

public : void WriteBuffer(IBuffer buffer)public void WriteBuffer(IBuffer buffer)Public Function WriteBuffer(buffer As IBuffer) As void// You can use this method in JavaScript.
Parameters
buffer
IBuffer IBuffer IBuffer IBuffer

The buffer.

See Also

WriteBuffer(IBuffer, UInt32, UInt32) WriteBuffer(IBuffer, UInt32, UInt32) WriteBuffer(IBuffer, UInt32, UInt32) WriteBuffer(IBuffer, UInt32, UInt32)

Writes a range of bytes from a buffer to the output stream.

public : void WriteBuffer(IBuffer buffer, unsigned int start, unsigned int count)public void WriteBuffer(IBuffer buffer, UInt32 start, UInt32 count)Public Function WriteBuffer(buffer As IBuffer, start As UInt32, count As UInt32) As void// You can use this method in JavaScript.
Parameters
buffer
IBuffer IBuffer IBuffer IBuffer

The buffer.

start
unsigned int UInt32 UInt32 UInt32

The starting byte tobe written.

count
unsigned int UInt32 UInt32 UInt32

The number of bytes to write.

See Also

WriteByte(Byte) WriteByte(Byte) WriteByte(Byte) WriteByte(Byte)

Writes a byte value to the output stream.

public : void WriteByte(Byte value)public void WriteByte(Byte value)Public Function WriteByte(value As Byte) As void// You can use this method in JavaScript.
Parameters
value
Byte Byte Byte Byte

The value.

WriteBytes(Byte[]) WriteBytes(Byte[]) WriteBytes(Byte[]) WriteBytes(Byte[])

Writes an array of byte values to the output stream.

public : void WriteBytes(Byte[] value)public void WriteBytes(Byte[] value)Public Function WriteBytes(value As Byte[]) As void// You can use this method in JavaScript.
Parameters
value
Byte[] Byte[] Byte[] Byte[]

The array of values.

WriteDateTime(DateTime) WriteDateTime(DateTime) WriteDateTime(DateTime) WriteDateTime(DateTime)

Writes a date and time value to the output stream.

public : void WriteDateTime(DateTime value)public void WriteDateTime(DateTimeOffset value)Public Function WriteDateTime(value As DateTimeOffset) As void// You can use this method in JavaScript.
Parameters
value
DateTime DateTimeOffset DateTimeOffset DateTimeOffset

The value to write.

WriteDouble(Double) WriteDouble(Double) WriteDouble(Double) WriteDouble(Double)

Writes a floating-point value to the output stream.

public : void WriteDouble(double value)public void WriteDouble(Double value)Public Function WriteDouble(value As Double) As void// You can use this method in JavaScript.
Parameters
value
double Double Double Double

The value to write.

WriteGuid(Guid) WriteGuid(Guid) WriteGuid(Guid) WriteGuid(Guid)

Writes a GUID value to the output stream.

public : void WriteGuid(PlatForm::Guid value)public void WriteGuid(Guid value)Public Function WriteGuid(value As Guid) As void// You can use this method in JavaScript.
Parameters
value
PlatForm::Guid Guid Guid Guid

The value to write.

WriteInt16(Int16) WriteInt16(Int16) WriteInt16(Int16) WriteInt16(Int16)

Writes a 16-bit integer value to the output stream.

public : void WriteInt16(short value)public void WriteInt16(Int16 value)Public Function WriteInt16(value As Int16) As void// You can use this method in JavaScript.
Parameters
value
short Int16 Int16 Int16

The value.

WriteInt32(Int32) WriteInt32(Int32) WriteInt32(Int32) WriteInt32(Int32)

Writes a 32-bit integer value to the output stream.

public : void WriteInt32(int value)public void WriteInt32(Int32 value)Public Function WriteInt32(value As Int32) As void// You can use this method in JavaScript.
Parameters
value
int Int32 Int32 Int32

The value.

WriteInt64(Int64) WriteInt64(Int64) WriteInt64(Int64) WriteInt64(Int64)

Writes a 64-bit integer value to the output stream.

public : void WriteInt64(long value)public void WriteInt64(Int64 value)Public Function WriteInt64(value As Int64) As void// You can use this method in JavaScript.
Parameters
value
long Int64 Int64 Int64

The value.

WriteSingle(Single) WriteSingle(Single) WriteSingle(Single) WriteSingle(Single)

Write a floating-point value to the output stream.

public : void WriteSingle(float value)public void WriteSingle(Single value)Public Function WriteSingle(value As Single) As void// You can use this method in JavaScript.
Parameters
value
float Single Single Single

The value to write.

WriteString(String) WriteString(String) WriteString(String) WriteString(String)

Writes a string value to the output stream.

public : unsigned int WriteString(PlatForm::String value)public uint WriteString(String value)Public Function WriteString(value As String) As uint// You can use this method in JavaScript.
Parameters
value
PlatForm::String String String String

The value to write.

Returns
unsigned int uint uint uint

The length of the string.

WriteTimeSpan(TimeSpan) WriteTimeSpan(TimeSpan) WriteTimeSpan(TimeSpan) WriteTimeSpan(TimeSpan)

Writes a time interval value to the output stream.

public : void WriteTimeSpan(TimeSpan value)public void WriteTimeSpan(TimeSpan value)Public Function WriteTimeSpan(value As TimeSpan) As void// You can use this method in JavaScript.
Parameters
value
TimeSpan TimeSpan TimeSpan TimeSpan

The value to write.

WriteUInt16(UInt16) WriteUInt16(UInt16) WriteUInt16(UInt16) WriteUInt16(UInt16)

Writes a 16-bit unsigned integer value to the output stream.

public : void WriteUInt16(unsigned short value)public void WriteUInt16(UInt16 value)Public Function WriteUInt16(value As UInt16) As void// You can use this method in JavaScript.
Parameters
value
unsigned short UInt16 UInt16 UInt16

The value.

WriteUInt32(UInt32) WriteUInt32(UInt32) WriteUInt32(UInt32) WriteUInt32(UInt32)

Writes a 32-bit unsigned integer value to the output stream.

public : void WriteUInt32(unsigned int value)public void WriteUInt32(UInt32 value)Public Function WriteUInt32(value As UInt32) As void// You can use this method in JavaScript.
Parameters
value
unsigned int UInt32 UInt32 UInt32

The value.

WriteUInt64(UInt64) WriteUInt64(UInt64) WriteUInt64(UInt64) WriteUInt64(UInt64)

Writes a 64-bit unsigned integer value to the output stream.

public : void WriteUInt64(unsigned __int64 value)public void WriteUInt64(UInt64 value)Public Function WriteUInt64(value As UInt64) As void// You can use this method in JavaScript.
Parameters
value
unsigned __int64 UInt64 UInt64 UInt64

The value.