IDataWriter IDataWriter IDataWriter Interface

Definition

Provides write access to an output stream.

public interface IDataWriterpublic interface IDataWriterPublic Interface IDataWriter
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

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
Value
ByteOrder ByteOrder ByteOrder

One of the enumeration values.

Attributes

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
Value
UnicodeEncoding UnicodeEncoding UnicodeEncoding

One of the enumeration values.

Attributes

UnstoredBufferLength UnstoredBufferLength UnstoredBufferLength

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

public uint UnstoredBufferLength { get; }public uint UnstoredBufferLength { get; }Public ReadOnly Property UnstoredBufferLength As uint
Value
uint uint uint

The available buffer length, in bytes.

Attributes

Methods

DetachBuffer() DetachBuffer() DetachBuffer()

Detaches a buffer that was previously attached to the writer.

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

The detached buffer.

Attributes

DetachStream() DetachStream() DetachStream()

Detaches a stream that was previously attached to the writer.

public IOutputStream DetachStream()public IOutputStream DetachStream()Public Function DetachStream() As IOutputStream
Returns
Attributes

FlushAsync() FlushAsync() FlushAsync()

Flushes data asynchronously.

public IAsyncOperation<bool> FlushAsync()public IAsyncOperation<bool> FlushAsync()Public Function FlushAsync() As IAsyncOperation( Of bool )
Returns

The stream flush operation.

Attributes

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)

Gets the size of a string.

public uint MeasureString(String value)public uint MeasureString(String value)Public Function MeasureString(value As String) As uint
Parameters
value
System.String System.String System.String

The string.

Returns
uint uint uint

The size of the string, in bytes.

Attributes

StoreAsync() StoreAsync() StoreAsync()

Commits data in the buffer to a backing store.

public DataWriterStoreOperation StoreAsync()public DataWriterStoreOperation StoreAsync()Public Function StoreAsync() As DataWriterStoreOperation
Returns
Attributes

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

Writes a Boolean value to the output stream.

public void WriteBoolean(Boolean value)public void WriteBoolean(Boolean value)Public Function WriteBoolean(value As Boolean) As void
Parameters
value
System.Boolean System.Boolean System.Boolean

The value.

Attributes

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
Parameters
buffer
IBuffer IBuffer IBuffer

The buffer.

Attributes

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, UInt32 start, UInt32 count)public void WriteBuffer(IBuffer buffer, UInt32 start, UInt32 count)Public Function WriteBuffer(buffer As IBuffer, start As UInt32, count As UInt32) As void
Parameters
buffer
IBuffer IBuffer IBuffer

The buffer.

start
System.UInt32 System.UInt32 System.UInt32

The starting byte tobe written.

count
System.UInt32 System.UInt32 System.UInt32

The number of bytes to write.

Attributes

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
Parameters
value
System.Byte System.Byte System.Byte

The value.

Attributes

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
Parameters
value
System.Byte[] System.Byte[] System.Byte[]

The array of values.

Attributes

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

Writes a date and time value to the output stream.

public void WriteDateTime(DateTime value)public void WriteDateTime(DateTime value)Public Function WriteDateTime(value As DateTime) As void
Parameters
value
DateTime DateTime DateTime

The value to write.

Attributes

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
Parameters
value
System.Double System.Double System.Double

The value to write.

Attributes

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

Writes a GUID value to the output stream.

public void WriteGuid(Guid value)public void WriteGuid(Guid value)Public Function WriteGuid(value As Guid) As void
Parameters
value
System.Guid System.Guid System.Guid

The value to write.

Attributes

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

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

public void WriteInt16(Int16 value)public void WriteInt16(Int16 value)Public Function WriteInt16(value As Int16) As void
Parameters
value
System.Int16 System.Int16 System.Int16

The value.

Attributes

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

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

public void WriteInt32(Int32 value)public void WriteInt32(Int32 value)Public Function WriteInt32(value As Int32) As void
Parameters
value
System.Int32 System.Int32 System.Int32

The value.

Attributes

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

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

public void WriteInt64(Int64 value)public void WriteInt64(Int64 value)Public Function WriteInt64(value As Int64) As void
Parameters
value
System.Int64 System.Int64 System.Int64

The value.

Attributes

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

Write a floating-point value to the output stream.

public void WriteSingle(Single value)public void WriteSingle(Single value)Public Function WriteSingle(value As Single) As void
Parameters
value
System.Single System.Single System.Single

The value to write.

Attributes

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

Writes a string value to the output stream.

public uint WriteString(String value)public uint WriteString(String value)Public Function WriteString(value As String) As uint
Parameters
value
System.String System.String System.String

The value to write.

Returns
uint uint uint

The length of the string.

Attributes

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
Parameters
value
TimeSpan TimeSpan TimeSpan

The value to write.

Attributes

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

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

public void WriteUInt16(UInt16 value)public void WriteUInt16(UInt16 value)Public Function WriteUInt16(value As UInt16) As void
Parameters
value
System.UInt16 System.UInt16 System.UInt16

The value.

Attributes

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

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

public void WriteUInt32(UInt32 value)public void WriteUInt32(UInt32 value)Public Function WriteUInt32(value As UInt32) As void
Parameters
value
System.UInt32 System.UInt32 System.UInt32

The value.

Attributes

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

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

public void WriteUInt64(UInt64 value)public void WriteUInt64(UInt64 value)Public Function WriteUInt64(value As UInt64) As void
Parameters
value
System.UInt64 System.UInt64 System.UInt64

The value.

Attributes