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
18namespace Poco {
19
20
21MemoryIOS::MemoryIOS(char* pBuffer, std::streamsize bufferSize):
22 _buf(pBuffer, bufferSize)
23{
24 poco_ios_init(&_buf);
25}
26
27
28MemoryIOS::~MemoryIOS()
29{
30}
31
32
33MemoryInputStream::MemoryInputStream(const char* pBuffer, std::streamsize bufferSize):
34 MemoryIOS(const_cast<char*>(pBuffer), bufferSize),
35 std::istream(&_buf)
36{
37}
38
39
40MemoryInputStream::~MemoryInputStream()
41{
42}
43
44
45MemoryOutputStream::MemoryOutputStream(char* pBuffer, std::streamsize bufferSize):
46 MemoryIOS(pBuffer, bufferSize),
47 std::ostream(&_buf)
48{
49}
50
51
52MemoryOutputStream::~MemoryOutputStream()
53{
54}
55
56
57} // namespace Poco
58