@@ -124,7 +124,7 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os,
124124 _ctx.putInt (" bsVersion" , BITSTREAM_FORMAT_VERSION);
125125
126126 // Allocate first buffer and add padding for incompressible blocks
127- const int bufSize = max (_blockSize + (_blockSize >> 3 ), 512 * 1024 );
127+ const int bufSize = max (_blockSize + (_blockSize >> 3 ), DEFAULT_BUFFER_SIZE );
128128 _buffers[0 ] = new SliceArray<byte>(new byte[bufSize], bufSize, 0 );
129129 _buffers[_jobs] = new SliceArray<byte>(new byte[0 ], 0 , 0 );
130130
@@ -208,7 +208,7 @@ CompressedOutputStream::CompressedOutputStream(OutputStream& os, Context& ctx, b
208208 _buffers = new SliceArray<byte>*[2 * _jobs];
209209
210210 // Allocate first buffer and add padding for incompressible blocks
211- const int bufSize = max (_blockSize + (_blockSize >> 3 ), 512 * 1024 );
211+ const int bufSize = max (_blockSize + (_blockSize >> 3 ), DEFAULT_BUFFER_SIZE );
212212 _buffers[0 ] = new SliceArray<byte>(new byte[bufSize], bufSize, 0 );
213213 _buffers[_jobs] = new SliceArray<byte>(new byte[0 ], 0 , 0 );
214214
@@ -356,7 +356,7 @@ ostream& CompressedOutputStream::write(const char* data, streamsize length)
356356
357357 if (_bufferId + 1 < nbTasks) {
358358 _bufferId++;
359- const int bufSize = max (_blockSize + (_blockSize >> 3 ), 512 * 1024 );
359+ const int bufSize = max (_blockSize + (_blockSize >> 3 ), DEFAULT_BUFFER_SIZE );
360360
361361 if (_buffers[_bufferId]->_length == 0 ) {
362362 delete[] _buffers[_bufferId]->_array ;
@@ -691,7 +691,8 @@ T EncodingTask<T>::run()
691691 CompressedOutputStream::notifyListeners (_listeners, evt);
692692 }
693693
694- const int bufSize = max (512 * 1024 , max (postTransformLength, blockLength + (blockLength >> 3 )));
694+ const int bufSize = max (CompressedOutputStream::DEFAULT_BUFFER_SIZE,
695+ max (postTransformLength, blockLength + (blockLength >> 3 )));
695696
696697 if (_data->_length < bufSize) {
697698 // Rare case where the transform expanded the input or
0 commit comments