IDataWriter IDataWriter IDataWriter IDataWriter Interface

Provides write access to an output stream.

Syntax

Declaration

public interface IDataWriterpublic 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 ByteOrderpublic ByteOrder ByteOrder { get; set; }

    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 UnicodeEncodingpublic UnicodeEncoding UnicodeEncoding { get; set; }

    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 uintpublic uint UnstoredBufferLength { get; }

    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 IBufferpublic IBuffer DetachBuffer()

    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 IOutputStreampublic IOutputStream DetachStream()

    Returns

  • FlushAsync()
    FlushAsync()
    FlushAsync()
    FlushAsync()

    Flushes data asynchronously.

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

    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(String)
    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 uintpublic uint MeasureString(String value)

    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 DataWriterStoreOperationpublic DataWriterStoreOperation StoreAsync()

    Returns

  • WriteBoolean(Boolean)
    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 voidpublic void WriteBoolean(Boolean value)

    Parameters

    • value
      System.Boolean
      System.Boolean
      System.Boolean
      System.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 voidpublic void WriteBuffer(IBuffer buffer)

    Parameters

  • 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, 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 voidpublic void WriteBuffer(IBuffer buffer, UInt32 start, UInt32 count)

    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(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 voidpublic void WriteByte(Byte value)

    Parameters

    • value
      System.Byte
      System.Byte
      System.Byte
      System.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 voidpublic void WriteBytes(Byte[] value)

    Parameters

    • value
      System.Byte[]
      System.Byte[]
      System.Byte[]
      System.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(DateTime value)Public Function WriteDateTime(value As DateTime) As voidpublic void WriteDateTime(DateTime value)

    Parameters

  • 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 voidpublic void WriteDouble(Double value)

    Parameters

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

      The value to write.

  • WriteGuid(Guid)
    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 voidpublic void WriteGuid(Guid value)

    Parameters

    • value
      System.Guid
      System.Guid
      System.Guid
      System.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(Int16 value)public void WriteInt16(Int16 value)Public Function WriteInt16(value As Int16) As voidpublic void WriteInt16(Int16 value)

    Parameters

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

      The value.

  • WriteInt32(Int32)
    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 voidpublic void WriteInt32(Int32 value)

    Parameters

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

      The value.

  • WriteInt64(Int64)
    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 voidpublic void WriteInt64(Int64 value)

    Parameters

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

      The value.

  • WriteSingle(Single)
    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 voidpublic void WriteSingle(Single value)

    Parameters

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

      The value to write.

  • WriteString(String)
    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 uintpublic uint WriteString(String value)

    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(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 voidpublic void WriteTimeSpan(TimeSpan value)

    Parameters

  • WriteUInt16(UInt16)
    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 voidpublic void WriteUInt16(UInt16 value)

    Parameters

    • value
      System.UInt16
      System.UInt16
      System.UInt16
      System.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(UInt32 value)public void WriteUInt32(UInt32 value)Public Function WriteUInt32(value As UInt32) As voidpublic void WriteUInt32(UInt32 value)

    Parameters

    • value
      System.UInt32
      System.UInt32
      System.UInt32
      System.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(UInt64 value)public void WriteUInt64(UInt64 value)Public Function WriteUInt64(value As UInt64) As voidpublic void WriteUInt64(UInt64 value)

    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.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.Storage.Streams.dll