DataWriter class
Writes data to an output stream.
Syntax
Public NotInheritable Class DataWriter Inherits Object Implements IDataWriter Implements IDisposable
Attributes
- ActivatableAttribute(Windows.Storage.Streams.IDataWriterFactory, NTDDI_WIN8)
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The DataWriter class has these types of members:
Constructors
The DataWriter class has these constructors.
| Constructor | Description |
|---|---|
| DataWriter() | Creates and initializes a new instance of the data writer. |
| DataWriter(IOutputStream) | Creates and initializes a new instance of the data writer to an output stream. |
Methods
The DataWriter class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| Close [C++, JavaScript] | Closes the current stream and releases system resources. |
| DetachBuffer | Detaches the buffer that is associated with the data writer. |
| DetachStream | Detaches the stream that is associated with the data writer. |
| Dispose [C#, VB] | Performs tasks associated with freeing, releasing, or resetting unmanaged resources. |
| FlushAsync | Flushes data asynchronously. |
| MeasureString | Gets the size of a string. |
| StoreAsync | Commits data in the buffer to a backing store. |
| WriteBoolean | Writes a Boolean value to the output stream. |
| WriteBuffer(IBuffer) | Writes the contents of the specified buffer to the output stream. |
| WriteBuffer(IBuffer, UInt32, UInt32) | Writes the specified bytes from a buffer to the output stream. |
| WriteByte | Writes a byte value to the output stream. |
| WriteBytes | Writes an array of byte values to the output stream. |
| WriteDateTime | Writes a date and time value to the output stream. |
| WriteDouble | Writes a floating-point value to the output stream. |
| WriteGuid | Writes a GUID value to the output stream. |
| WriteInt16 | Writes a 16-bit integer value to the output stream. |
| WriteInt32 | Writes a 32-bit integer value to the output stream. |
| WriteInt64 | Writes a 64-bit integer value to the output stream. |
| WriteSingle | Writes a floating-point value to the output stream. |
| WriteString | Writes a string value to the output stream. |
| WriteTimeSpan | Writes a time-interval value to the output stream. |
| WriteUInt16 | Writes a 16-bit unsigned integer value to the output stream. |
| WriteUInt32 | Writes a 32-bit unsigned integer value to the output stream. |
| WriteUInt64 | Writes a 64-bit unsigned integer value to the output stream. |
Properties
The DataWriter class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Gets or sets the byte order of the data in the output stream. | |
| Read/write | Gets or sets the Unicode character encoding for the output stream. | |
| Read-only | Gets the size of the buffer that has not been used. |
Examples
The following example shows how to write and read strings to an in-memory stream. For the full code sample, see Reading and writing data sample.
No code example is currently available or this language may not be supported.
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013
