mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 03:03:23 +02:00
SF#3563999: Size BinaryWriter based on buffer's capacity(), not size()
This commit is contained in:
@@ -179,14 +179,18 @@ public:
|
|||||||
BasicMemoryBinaryReader(Buffer<T>& data, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
BasicMemoryBinaryReader(Buffer<T>& data, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
||||||
BinaryReader(_istr, byteOrder),
|
BinaryReader(_istr, byteOrder),
|
||||||
_data(data),
|
_data(data),
|
||||||
_istr(data.begin(), data.size())
|
_istr(data.begin(), data.capacity())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicMemoryBinaryReader(Buffer<T>& data, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
BasicMemoryBinaryReader(Buffer<T>& data, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
||||||
BinaryReader(_istr, encoding, byteOrder),
|
BinaryReader(_istr, encoding, byteOrder),
|
||||||
_data(data),
|
_data(data),
|
||||||
_istr(data.begin(), data.size())
|
_istr(data.begin(), data.capacity())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
~BasicMemoryBinaryReader()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -194,17 +194,22 @@ public:
|
|||||||
BasicMemoryBinaryWriter(Buffer<T>& data, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
BasicMemoryBinaryWriter(Buffer<T>& data, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
||||||
BinaryWriter(_ostr, byteOrder),
|
BinaryWriter(_ostr, byteOrder),
|
||||||
_data(data),
|
_data(data),
|
||||||
_ostr(data.begin(), data.size())
|
_ostr(data.begin(), data.capacity())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicMemoryBinaryWriter(Buffer<T>& data, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
BasicMemoryBinaryWriter(Buffer<T>& data, TextEncoding& encoding, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER):
|
||||||
BinaryWriter(_ostr, encoding, byteOrder),
|
BinaryWriter(_ostr, encoding, byteOrder),
|
||||||
_data(data),
|
_data(data),
|
||||||
_ostr(data.begin(), data.size())
|
_ostr(data.begin(), data.capacity())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~BasicMemoryBinaryWriter()
|
||||||
|
{
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
|
||||||
Buffer<T>& data()
|
Buffer<T>& data()
|
||||||
{
|
{
|
||||||
return _data;
|
return _data;
|
||||||
|
Reference in New Issue
Block a user