IDataWriter IDataWriter IDataWriter IDataWriter Interface

Provides write access to an output stream.

Syntax

Declaration

public interface IDataWriterpublic interface IDataWriterPublic Interface IDataWriter

Properties summary

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

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

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

Methods summary

Detaches a buffer that was previously attached to the writer.

Detaches a stream that was previously attached to the writer.

Flushes data asynchronously.

Gets the size of a string.

Commits data in the buffer to a backing store.

Writes a Boolean value to the output stream.

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

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

Writes a byte value to the output stream.

Writes an array of byte values to the output stream.

Writes a date and time value to the output stream.

Writes a floating-point value to the output stream.

Writes a GUID value to the output stream.

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

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

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

Write a floating-point value to the output stream.

Writes a string value to the output stream.

Writes a time interval value to the output stream.

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

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

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

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

    Property Value

  • 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

    Property Value

  • UnstoredBufferLength
    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

    Property Value

    • uint
      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

    Returns

  • 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

    Returns

  • FlushAsync()
    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.

    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.

    For streams which write data immediately, FlushAsync() has no effect and completes immediately.

  • MeasureString(System.String)
    MeasureString(System.String)
    MeasureString(System.String)
    MeasureString(System.String)

    Gets the size of a string.

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

    Parameters

    • value
      System.String
      System.String
      System.String
      System.String

      The string.

    Returns

    • uint
      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

    Returns

  • WriteBoolean(System.Boolean)
    WriteBoolean(System.Boolean)
    WriteBoolean(System.Boolean)
    WriteBoolean(System.Boolean)

    Writes a Boolean value to the output stream.

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

    Parameters

    • value
      System.Boolean
      System.Boolean
      System.Boolean
      System.Boolean

      The value.

  • WriteBuffer(Windows.Storage.Streams.IBuffer)
    WriteBuffer(Windows.Storage.Streams.IBuffer)
    WriteBuffer(Windows.Storage.Streams.IBuffer)
    WriteBuffer(Windows.Storage.Streams.IBuffer)

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

    public void WriteBuffer(Windows.Storage.Streams.IBuffer buffer)public void WriteBuffer(Windows.Storage.Streams.IBuffer buffer)Public Function WriteBuffer(buffer As Windows.Storage.Streams.IBuffer) As void

    Parameters

  • WriteBuffer(Windows.Storage.Streams.IBuffer,System.UInt32,System.UInt32)
    WriteBuffer(Windows.Storage.Streams.IBuffer,System.UInt32,System.UInt32)
    WriteBuffer(Windows.Storage.Streams.IBuffer,System.UInt32,System.UInt32)
    WriteBuffer(Windows.Storage.Streams.IBuffer,System.UInt32,System.UInt32)

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

    public void WriteBuffer(Windows.Storage.Streams.IBuffer buffer,System.UInt32 start,System.UInt32 count)public void WriteBuffer(Windows.Storage.Streams.IBuffer buffer,System.UInt32 start,System.UInt32 count)Public Function WriteBuffer(buffer As Windows.Storage.Streams.IBuffer,start As System.UInt32,count As System.UInt32) As void

    Parameters

    • buffer

      The buffer.

    • start
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The starting byte tobe written.

    • count
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The number of bytes to write.

  • WriteByte(System.Byte)
    WriteByte(System.Byte)
    WriteByte(System.Byte)
    WriteByte(System.Byte)

    Writes a byte value to the output stream.

    public void WriteByte(System.Byte value)public void WriteByte(System.Byte value)Public Function WriteByte(value As System.Byte) As void

    Parameters

    • value
      System.Byte
      System.Byte
      System.Byte
      System.Byte

      The value.

  • WriteBytes(System.Byte[])
    WriteBytes(System.Byte[])
    WriteBytes(System.Byte[])
    WriteBytes(System.Byte[])

    Writes an array of byte values to the output stream.

    public void WriteBytes(System.Byte[] value)public void WriteBytes(System.Byte[] value)Public Function WriteBytes(value As System.Byte[]) As void

    Parameters

    • value
      System.Byte[]
      System.Byte[]
      System.Byte[]
      System.Byte[]

      The array of values.

  • WriteDateTime(Windows.Foundation.DateTime)
    WriteDateTime(Windows.Foundation.DateTime)
    WriteDateTime(Windows.Foundation.DateTime)
    WriteDateTime(Windows.Foundation.DateTime)

    Writes a date and time value to the output stream.

    public void WriteDateTime(Windows.Foundation.DateTime value)public void WriteDateTime(Windows.Foundation.DateTime value)Public Function WriteDateTime(value As Windows.Foundation.DateTime) As void

    Parameters

  • WriteDouble(System.Double)
    WriteDouble(System.Double)
    WriteDouble(System.Double)
    WriteDouble(System.Double)

    Writes a floating-point value to the output stream.

    public void WriteDouble(System.Double value)public void WriteDouble(System.Double value)Public Function WriteDouble(value As System.Double) As void

    Parameters

    • value
      System.Double
      System.Double
      System.Double
      System.Double

      The value to write.

  • WriteGuid(System.Guid)
    WriteGuid(System.Guid)
    WriteGuid(System.Guid)
    WriteGuid(System.Guid)

    Writes a GUID value to the output stream.

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

    Parameters

    • value
      System.Guid
      System.Guid
      System.Guid
      System.Guid

      The value to write.

  • WriteInt16(System.Int16)
    WriteInt16(System.Int16)
    WriteInt16(System.Int16)
    WriteInt16(System.Int16)

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

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

    Parameters

    • value
      System.Int16
      System.Int16
      System.Int16
      System.Int16

      The value.

  • WriteInt32(System.Int32)
    WriteInt32(System.Int32)
    WriteInt32(System.Int32)
    WriteInt32(System.Int32)

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

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

    Parameters

    • value
      System.Int32
      System.Int32
      System.Int32
      System.Int32

      The value.

  • WriteInt64(System.Int64)
    WriteInt64(System.Int64)
    WriteInt64(System.Int64)
    WriteInt64(System.Int64)

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

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

    Parameters

    • value
      System.Int64
      System.Int64
      System.Int64
      System.Int64

      The value.

  • WriteSingle(System.Single)
    WriteSingle(System.Single)
    WriteSingle(System.Single)
    WriteSingle(System.Single)

    Write a floating-point value to the output stream.

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

    Parameters

    • value
      System.Single
      System.Single
      System.Single
      System.Single

      The value to write.

  • WriteString(System.String)
    WriteString(System.String)
    WriteString(System.String)
    WriteString(System.String)

    Writes a string value to the output stream.

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

    Parameters

    • value
      System.String
      System.String
      System.String
      System.String

      The value to write.

    Returns

    • uint
      uint
      uint
      uint

      The length of the string.

  • WriteTimeSpan(Windows.Foundation.TimeSpan)
    WriteTimeSpan(Windows.Foundation.TimeSpan)
    WriteTimeSpan(Windows.Foundation.TimeSpan)
    WriteTimeSpan(Windows.Foundation.TimeSpan)

    Writes a time interval value to the output stream.

    public void WriteTimeSpan(Windows.Foundation.TimeSpan value)public void WriteTimeSpan(Windows.Foundation.TimeSpan value)Public Function WriteTimeSpan(value As Windows.Foundation.TimeSpan) As void

    Parameters

  • WriteUInt16(System.UInt16)
    WriteUInt16(System.UInt16)
    WriteUInt16(System.UInt16)
    WriteUInt16(System.UInt16)

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

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

    Parameters

    • value
      System.UInt16
      System.UInt16
      System.UInt16
      System.UInt16

      The value.

  • WriteUInt32(System.UInt32)
    WriteUInt32(System.UInt32)
    WriteUInt32(System.UInt32)
    WriteUInt32(System.UInt32)

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

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

    Parameters

    • value
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The value.

  • WriteUInt64(System.UInt64)
    WriteUInt64(System.UInt64)
    WriteUInt64(System.UInt64)
    WriteUInt64(System.UInt64)

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

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

    Parameters

    • value
      System.UInt64
      System.UInt64
      System.UInt64
      System.UInt64

      The value.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.GuidAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.Storage.Streams.dll