acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
ByteArrayOutputStream.h
1// Copyright (C) 2009,2010,2011,2012 GlavSoft LLC.
2// All rights reserved.
3//
4//-------------------------------------------------------------------------
5// This file is part of the T i g h t V N C software. Please visit our Web site:
6//
7// http://www.t i g h t v n c.com/
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 2 of the License, or
12// (at your option) any later version.
13//
14// This program is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License along
20// with this program; if not, w_rite to the Free Software Foundation, Inc.,
21// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22//-------------------------------------------------------------------------
23//
24
25#pragma once
26
27
28#include "acme/input_output/OutputStream.h"
29
30//namespace subsystem
31//{
35 class CLASS_DECL_ACME ByteArrayOutputStream : public OutputStream
36 {
37 public:
38 static const memsize DEFAULT_INNER_BUFFER_CAPACITY = 1024;
39 public:
40
41 bool m_bOwnMemory;
42 char_pointer m_buffer;
43 ::memory m_memory;
44 memsize m_size;
45 memsize m_max;
46
47
52 //ByteArrayOutputStream(memsize max);
57 ByteArrayOutputStream(::particle * pparticle, memsize max);
58 ByteArrayOutputStream(::particle * pparticle, void *alienMemory, memsize max);
64 //ByteArrayOutputStream(void *alienMemory);
65
66 ~ByteArrayOutputStream() override;
67
68
69 virtual void _initialize_byte_array_output_stream(::particle * pparticle, memsize max = -1);
70
71 virtual void _initialize_byte_array_output_stream(::particle * pparticle, void *alienMemory, memsize size);
72
78 memsize defer_write(const void *buffer, memsize len) override;
79
83 memsize size() const;
84
88 const_char_pointer toByteArray() const;
89
90 //protected:
91 };
92//}//namespace subsystem
ByteArrayOutputStream()
Definition ByteArrayOutputStream.cpp:50
const_char_pointer toByteArray() const
Definition ByteArrayOutputStream.cpp:151
memsize size() const
Definition ByteArrayOutputStream.cpp:146
Definition OutputStream.h:38
virtual memsize defer_write(const void *buffer, ::memsize len)=0
Definition memory.h:33