libUTL++
BinaryData.h
1 #pragma once
2 
4 
5 #include <libutl/Vector.h>
6 
8 
9 UTL_NS_BEGIN;
10 
12 
20 
22 class BinaryData : public Vector<byte_t>
23 {
25 
26 public:
32  BinaryData(size_t size, size_t increment = 1)
33  : Vector<byte_t>(size, increment)
34  {
35  }
36 
44  BinaryData(byte_t* array, size_t size, bool owner = true, size_t increment = 1)
45  : Vector<byte_t>(array, size, owner, increment)
46  {
47  }
48 
49  virtual void serialize(Stream& stream, uint_t io, uint_t mode = ser_default);
50 
51 private:
52  void
53  init()
54  {
55  setIncrement(1);
56  }
57  void
58  deInit()
59  {
60  }
61 };
62 
64 
65 UTL_NS_END;
void serialize(bool &b, Stream &stream, uint_t io, uint_t mode=ser_default)
Serialize a boolean.
Vector of bytes.
Definition: BinaryData.h:22
void deInit()
De-initialize UTL++.
BinaryData(size_t size, size_t increment=1)
Constructor.
Definition: BinaryData.h:32
default representation (via getSerializeMode())
Definition: util.h:75
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Definition: macros.h:688
unsigned char byte_t
Unsigned character.
Definition: types.h:31
unsigned int uint_t
Unsigned integer.
Definition: types.h:59
BinaryData(byte_t *array, size_t size, bool owner=true, size_t increment=1)
Constructor.
Definition: BinaryData.h:44
Stream I/O abstraction.
Definition: Stream.h:68
A sequence of same-type objects.
Definition: Ordering.h:14
void init()
Initialize UTL++.