| 1 | // | 
|---|---|
| 2 | // MemoryStream.cpp | 
| 3 | // | 
| 4 | // Library: Foundation | 
| 5 | // Package: Streams | 
| 6 | // Module: MemoryStream | 
| 7 | // | 
| 8 | // Copyright (c) 2009, Applied Informatics Software Engineering GmbH. | 
| 9 | // and Contributors. | 
| 10 | // | 
| 11 | // SPDX-License-Identifier: BSL-1.0 | 
| 12 | // | 
| 13 | |
| 14 | |
| 15 | #include "Poco/MemoryStream.h" | 
| 16 | |
| 17 | |
| 18 | namespace Poco { | 
| 19 | |
| 20 | |
| 21 | MemoryIOS::MemoryIOS(char* pBuffer, std::streamsize bufferSize): | 
| 22 | _buf(pBuffer, bufferSize) | 
| 23 | { | 
| 24 | poco_ios_init(&_buf); | 
| 25 | } | 
| 26 | |
| 27 | |
| 28 | MemoryIOS::~MemoryIOS() | 
| 29 | { | 
| 30 | } | 
| 31 | |
| 32 | |
| 33 | MemoryInputStream::MemoryInputStream(const char* pBuffer, std::streamsize bufferSize): | 
| 34 | MemoryIOS(const_cast<char*>(pBuffer), bufferSize), | 
| 35 | std::istream(&_buf) | 
| 36 | { | 
| 37 | } | 
| 38 | |
| 39 | |
| 40 | MemoryInputStream::~MemoryInputStream() | 
| 41 | { | 
| 42 | } | 
| 43 | |
| 44 | |
| 45 | MemoryOutputStream::MemoryOutputStream(char* pBuffer, std::streamsize bufferSize): | 
| 46 | MemoryIOS(pBuffer, bufferSize), | 
| 47 | std::ostream(&_buf) | 
| 48 | { | 
| 49 | } | 
| 50 | |
| 51 | |
| 52 | MemoryOutputStream::~MemoryOutputStream() | 
| 53 | { | 
| 54 | } | 
| 55 | |
| 56 | |
| 57 | } // namespace Poco | 
| 58 | 
