[#DataStream]
= DataStream
:mrdocs:

Double ended buffer combining vector and stream&hyphen;like interfaces&period;

== Synopsis

Declared in `&lt;streams&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class DataStream;
----

== Description

&gt;&gt; and &lt;&lt; read and write unformatted data using the above serialization templates&period; Fills with data in linear time&semi; some stringstream implementations take N&circ;2 time&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:DataStream/allocator_type.adoc[`allocator&lowbar;type`] 
| Allocator type of the underlying container&period;
| xref:DataStream/const_iterator.adoc[`const&lowbar;iterator`] 
| Const iterator over the stream&apos;s elements&period;
| xref:DataStream/const_reference.adoc[`const&lowbar;reference`] 
| Const reference to an element of the stream&period;
| xref:DataStream/difference_type.adoc[`difference&lowbar;type`] 
| Signed difference type of the underlying container&period;
| xref:DataStream/iterator.adoc[`iterator`] 
| Mutable iterator over the stream&apos;s elements&period;
| xref:DataStream/reference.adoc[`reference`] 
| Reference to an element of the stream&period;
| xref:DataStream/reverse_iterator.adoc[`reverse&lowbar;iterator`] 
| Reverse iterator over the stream&apos;s elements&period;
| xref:DataStream/size_type.adoc[`size&lowbar;type`] 
| Unsigned size type of the underlying container&period;
| xref:DataStream/value_type.adoc[`value&lowbar;type`] 
| Element type stored in the stream&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:DataStream/2constructor-031.adoc[`DataStream`]         [.small]#[constructor]#
| Constructors
| xref:DataStream/GetMemoryUsage.adoc[`GetMemoryUsage`] 
| Compute total memory usage of this object (own memory &plus; any dynamic memory)&period;
| xref:DataStream/begin-0d.adoc[`begin`] 
| `begin` overloads
| xref:DataStream/clear.adoc[`clear`] 
| Empty the stream and reset the read position&period;
| xref:DataStream/data-098.adoc[`data`] 
| `data` overloads
| xref:DataStream/empty.adoc[`empty`] 
| Return true if no unread elements remain&period;
| xref:DataStream/end-0e.adoc[`end`] 
| `end` overloads
| xref:DataStream/ignore.adoc[`ignore`] 
| Skip `num&lowbar;ignore` bytes from the front of the stream, advancing the read position&period;
| xref:DataStream/operator_rshift.adoc[`operator&gt;&gt;`] 
| Deserialize an object from the front of the stream and return this stream&period;
| xref:DataStream/operator_subs-0e.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:DataStream/read.adoc[`read`] 
| Read bytes from the front of the stream into `dst`, advancing the read position&period;
| xref:DataStream/reserve.adoc[`reserve`] 
| Reserve capacity for `n` unread elements&period;
| xref:DataStream/resize.adoc[`resize`] 
| Resize the unread region to `n` elements, filling new ones with `c`&period;
| xref:DataStream/size.adoc[`size`] 
| Return the number of unread elements&period;
| xref:DataStream/str.adoc[`str`] 
| Return the unread contents of the stream as a std&colon;&colon;string&period;
| xref:DataStream/write.adoc[`write`] 
| Append a buffer of bytes to the end of the stream&period;
| xref:DataStream/operator_lshift.adoc[`operator&lt;&lt;`] 
| Serialize an object to the end of the stream and return this stream&period;
|===


== Protected Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:DataStream/vector_type.adoc[`vector&lowbar;type`] 
| Underlying byte container type backing the stream&period;
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:DataStream/m_read_pos.adoc[`m&lowbar;read&lowbar;pos`] 
| Offset of the first unread byte within vch&period;
| xref:DataStream/vch.adoc[`vch`] 
| Backing buffer holding both already&hyphen;read and unread bytes&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
