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)public uint MeasureString(System.String)Public Function MeasureString(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)public void WriteBoolean(System.Boolean)Public Function WriteBoolean(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)public void WriteBuffer(Windows.Storage.Streams.IBuffer)Public Function WriteBuffer(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,System.UInt32,System.UInt32)public void WriteBuffer(Windows.Storage.Streams.IBuffer,System.UInt32,System.UInt32)Public Function WriteBuffer(Windows.Storage.Streams.IBuffer,System.UInt32,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)public void WriteByte(System.Byte)Public Function WriteByte(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[])public void WriteBytes(System.Byte[])Public Function WriteBytes(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)public void WriteDateTime(Windows.Foundation.DateTime)Public Function WriteDateTime(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)public void WriteDouble(System.Double)Public Function WriteDouble(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)public void WriteGuid(System.Guid)Public Function WriteGuid(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)public void WriteInt16(System.Int16)Public Function WriteInt16(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)public void WriteInt32(System.Int32)Public Function WriteInt32(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)public void WriteInt64(System.Int64)Public Function WriteInt64(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)public void WriteSingle(System.Single)Public Function WriteSingle(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)public uint WriteString(System.String)Public Function WriteString(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)public void WriteTimeSpan(Windows.Foundation.TimeSpan)Public Function WriteTimeSpan(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)public void WriteUInt16(System.UInt16)Public Function WriteUInt16(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)public void WriteUInt32(System.UInt32)Public Function WriteUInt32(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)public void WriteUInt64(System.UInt64)Public Function WriteUInt64(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