68 : m_pContentBuf(nullptr)
72 , m_bCompressed(isCompressed)
75 throw std::range_error(
"bad Object size");
94 sal_uInt8* pCompressBuffer = xCompressBuf.get();
184 return static_cast<bool>(SVBT16ToUInt16(aValue));
192 sal_uInt16 nRead =
QuickRead(aValue,
sizeof(aValue));
194 *pFailure = (nRead !=
sizeof(aValue));
195 return SVBT32ToUInt32(aValue);
203 sal_uInt16 nRead =
QuickRead(aValue,
sizeof(aValue));
205 *pFailure = (nRead !=
sizeof(aValue));
206 return SVBT16ToUInt16(aValue);
215 return static_cast<sal_Int32
>(SVBT32ToUInt32(aValue));
225 return static_cast<sal_Int16
>(SVBT16ToUInt16(aValue));
233 sal_uInt16 nRead =
QuickRead(&aValue,
sizeof(aValue));
235 *pFailure = (nRead !=
sizeof(aValue));
247 memset(s.c, 0,
sizeof(s.c));
249#if defined(OSL_BIGENDIAN)
250 for (
size_t i = 0;
i < 4; ++
i)
251 std::swap(s.c[
i], s.c[7 -
i]);
275 sal_uInt32 DstSize = 0;
279 switch (*pSrc & 0xC0)
286 Cnt = (*pSrc++ & 0x3F) + 1;
289 memset(pDst, 0, Cnt);
301 Cnt = ((*pSrc & 0x38) >> 3) + 1;
304 memset(pDst, 0, Cnt);
307 Cnt = (*pSrc++ & 0x07) + 1;
313 memcpy(pDst, pSrc, Cnt);
334 Cnt = (*pSrc++ & 0x3F) + 1;
340 memcpy(pDst, pSrc, Cnt);
350 return static_cast<sal_uInt16
>(DstSize);
363 if (diskSize <
sizeof diskSize)
364 throw std::range_error(
"Too small size");
OUString QuickReadStringPtr()
@descr quick read string with 1252
sal_uInt16 QuickReaduInt16(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
sal_uInt16 QuickRead(void *buf, sal_uInt16 len)
@descr read len bytes from object stream to buffer
sal_uInt16 CheckExtra()
@descr check if extra bytes
void SkipExtra()
@descr skip extra bytes
void SeekRel(sal_uInt16 pos)
@descr SeekRel pos in object stream/buffer
double QuickReadDouble()
@descr Quick read double
sal_Int16 QuickReadInt16()
@descr Quick read sal_Int16
void ReadComplete()
@descr signal complete to release object buffer
void Read2Buffer()
@descr read object data from stream to buffer
std::vector< sal_uInt8 > m_BigBuffer
sal_uInt8 QuickReaduInt8(bool *pFailure=nullptr)
@descr Quick read sal_uInt8
sal_uInt16 remainingSize() const
static sal_uInt16 DecompressBuffer(sal_uInt8 *pDst, sal_uInt8 *pSrc, sal_uInt16 Size)
@descr decompress data buffer from pSrc to pDst Refer to the CAmiPro40File::DecompressObject(~) in LW...
sal_uInt8 m_SmallBuffer[100]
void Seek(sal_uInt16 pos)
@descr Seek to pos in object buffer/buffer
sal_uInt32 QuickReaduInt32(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
sal_Int32 QuickReadInt32()
@descr Quick read sal_Int32
LwpObjectStream(LwpSvStream *pStrm, bool isCompressed, sal_uInt16 size)
@descr ctor() from LwpSvStream
sal_uInt8 * AllocBuffer(sal_uInt16 size)
@descr alloc size of buffer
bool QuickReadBool()
@descr Quick read sal_Bool
void ReleaseBuffer()
@descr release object buffer
sal_uInt8 * m_pContentBuf
encapsulate XInputStream to provide SvStream like interfaces
size_t Read(void *bytes, size_t nBytesToRead)
@descr read nBytesToRead bytes to buf