summaryrefslogtreecommitdiff
path: root/buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.cpp')
-rw-r--r--buffer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/buffer.cpp b/buffer.cpp
index 8632d34..0c6a82a 100644
--- a/buffer.cpp
+++ b/buffer.cpp
@@ -38,6 +38,15 @@ Buffer::Buffer() : buf_(0), length_(0)
{
}
+Buffer::Buffer(u_int32_t length) : length_(length)
+{
+ buf_ = new u_int8_t[length_];
+ if(buf_)
+ std::memset(buf_, 0, length_);
+ else
+ length_ = 0;
+}
+
Buffer::Buffer(u_int8_t* data, u_int32_t length) : length_(length)
{
buf_ = new u_int8_t[length_];