azure-core
Public Member Functions | List of all members
Azure::Core::IO::MemoryBodyStream Class Referencefinal

Azure::Core::IO::BodyStream providing data from an initialized memory buffer.

#include <body_stream.hpp>

Inheritance diagram for Azure::Core::IO::MemoryBodyStream:
Azure::Core::IO::BodyStream

Public Member Functions

 MemoryBodyStream (std::vector< uint8_t > const &&)=delete
 
 MemoryBodyStream (std::vector< uint8_t > const &buffer)
 Construct using vector of bytes. More...
 
 MemoryBodyStream (const uint8_t *data, size_t length)
 Construct using buffer pointer and its size. More...
 
int64_t Length () const override
 Get the length of the data. More...
 
void Rewind () override
 
- Public Member Functions inherited from Azure::Core::IO::BodyStream
virtual ~BodyStream ()=default
 Destructs BodyStream. More...
 
size_t Read (uint8_t *buffer, size_t count, Azure::Core::Context const &context=Azure::Core::Context())
 Read portion of data into a buffer. More...
 
size_t ReadToCount (uint8_t *buffer, size_t count, Azure::Core::Context const &context=Azure::Core::Context())
 Read Azure::Core::IO::BodyStream into a buffer until the buffer is filled, or until the stream is read to end. More...
 
std::vector< uint8_t > ReadToEnd (Azure::Core::Context const &context=Azure::Core::Context())
 Read Azure::Core::IO::BodyStream until the stream is read to end, allocating memory for the entirety of contents. More...
 

Constructor & Destructor Documentation

◆ MemoryBodyStream() [1/2]

Azure::Core::IO::MemoryBodyStream::MemoryBodyStream ( std::vector< uint8_t > const &  buffer)
inline
Parameters
bufferVector of bytes with the contents to provide the data from to the readers.

◆ MemoryBodyStream() [2/2]

Azure::Core::IO::MemoryBodyStream::MemoryBodyStream ( const uint8_t *  data,
size_t  length 
)
inlineexplicit
Parameters
dataPointer to a first byte of the buffer with the contents to provide the data from to the readers.
lengthSize of the buffer.

Member Function Documentation

◆ Length()

int64_t Azure::Core::IO::MemoryBodyStream::Length ( ) const
inlineoverridevirtual
Remarks
Used with the HTTP Content-Length header.

Implements Azure::Core::IO::BodyStream.


The documentation for this class was generated from the following files: