CatapultServer  v0.5.0.1 (Elephant)
MemoryStream.h
Go to the documentation of this file.
1 
21 #pragma once
23 #include <vector>
24 
25 namespace catapult { namespace extensions {
26 
28  class MemoryStream : public io::BufferInputStreamAdapter<std::vector<uint8_t>>, public io::OutputStream {
29  public:
31  explicit MemoryStream(std::vector<uint8_t>& buffer);
32 
33  public:
34  void write(const RawBuffer& buffer) override;
35 
36  void flush() override;
37 
38  private:
39  std::vector<uint8_t>& m_buffer;
40  };
41 }}
m_buffer
std::vector< uint8_t > & m_buffer
Definition: MemoryBlockStorage.cpp:161
catapult::extensions::MemoryStream::flush
void flush() override
Definition: MemoryStream.cpp:35
catapult::extensions::MemoryStream
Memory-based implementation of input and output stream.
Definition: MemoryStream.h:28
MemoryStream.h
catapult::extensions::MemoryStream::m_buffer
std::vector< uint8_t > & m_buffer
Definition: MemoryStream.h:39
catapult::io::BufferInputStreamAdapter
Adapt a typed buffer to be used as an input stream.
Definition: BufferInputStreamAdapter.h:30
catapult::extensions::MemoryStream::write
void write(const RawBuffer &buffer) override
Definition: MemoryStream.cpp:31
catapult
Definition: AddressExtractionExtension.cpp:28
BufferInputStreamAdapter.h
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
catapult::extensions::MemoryStream::MemoryStream
MemoryStream(std::vector< uint8_t > &buffer)
Creates a memory stream around buffer.
Definition: MemoryStream.cpp:25