aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/stream.cpp20
-rw-r--r--common/stream.h4
2 files changed, 2 insertions, 22 deletions
diff --git a/common/stream.cpp b/common/stream.cpp
index 718c806ff3..8f8f278afd 100644
--- a/common/stream.cpp
+++ b/common/stream.cpp
@@ -231,21 +231,13 @@ BufferedReadStream::BufferedReadStream(ReadStream *parentStream, uint32 bufSize,
_realBufSize(bufSize) {
assert(parentStream);
- allocBuf(bufSize);
- assert(_buf);
-}
-
-void BufferedReadStream::allocBuf(uint32 bufSize) {
_buf = new byte[bufSize];
+ assert(_buf);
}
BufferedReadStream::~BufferedReadStream() {
if (_disposeParentStream)
delete _parentStream;
- deallocBuf();
-}
-
-void BufferedReadStream::deallocBuf() {
delete[] _buf;
}
@@ -334,7 +326,7 @@ BufferedWriteStream::BufferedWriteStream(WriteStream *parentStream, uint32 bufSi
_bufSize(bufSize) {
assert(parentStream);
- allocBuf(bufSize);
+ _buf = new byte[bufSize];
assert(_buf);
}
@@ -344,14 +336,6 @@ BufferedWriteStream::~BufferedWriteStream() {
if (_disposeParentStream)
delete _parentStream;
- deallocBuf();
-}
-
-void BufferedWriteStream::allocBuf(uint32 bufSize) {
- _buf = new byte[bufSize];
-}
-
-void BufferedWriteStream::deallocBuf() {
delete[] _buf;
}
diff --git a/common/stream.h b/common/stream.h
index 10cc8c79cd..4e627c2b1d 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -497,8 +497,6 @@ protected:
bool _eos; // end of stream
uint32 _bufSize;
uint32 _realBufSize;
- void allocBuf(uint32 bufSize);
- void deallocBuf();
public:
BufferedReadStream(ReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::NO);
@@ -538,8 +536,6 @@ protected:
uint32 _pos;
uint32 _bufSize;
bool flushBuffer(); // write out the data in the buffer
- void allocBuf(uint32 bufSize);
- void deallocBuf();
public:
BufferedWriteStream(WriteStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::NO);