summaryrefslogtreecommitdiff
path: root/include/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-08-17 13:19:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-27 09:10:04 +0200
commita6ad198d097fb4a503c8d5831d484ff46721134b (patch)
treee82ca01e800c5f50ce8db7bd8eb610790ee13c8d /include/package
parent03b31a8ad48e3b8a9e54203ff3856702557757b5 (diff)
tdf#158556 use more comphelper::ByteReader
which avoids a ton of temporary uno::Sequence being created Change-Id: I237bb69395f692bb0272ca0daec05b81af828e01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171968 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'include/package')
-rw-r--r--include/package/Inflater.hxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/package/Inflater.hxx b/include/package/Inflater.hxx
index e0d44d21d6f6..d59d220acfc4 100644
--- a/include/package/Inflater.hxx
+++ b/include/package/Inflater.hxx
@@ -51,6 +51,28 @@ public:
sal_Int32 getLastInflateError() const { return nLastInflateError; }
};
+class UNLESS_MERGELIBS(DLLPUBLIC_PACKAGE) InflaterBytes final
+{
+ typedef struct z_stream_s z_stream;
+
+ bool bFinished, bNeedDict;
+ sal_Int32 nOffset, nLength, nLastInflateError;
+ std::unique_ptr<z_stream> pStream;
+ const sal_Int8* sInBuffer;
+ sal_Int32 doInflateBytes (sal_Int8* pOutBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength);
+
+public:
+ InflaterBytes(bool bNoWrap);
+ ~InflaterBytes();
+ void setInput( const sal_Int8* pBuffer, sal_Int32 nLen );
+ bool needsDictionary() const { return bNeedDict; }
+ bool finished() const { return bFinished; }
+ sal_Int32 doInflateSegment( sal_Int8* pOutBuffer, sal_Int32 nBufLen, sal_Int32 nNewOffset, sal_Int32 nNewLength );
+ void end( );
+
+ sal_Int32 getLastInflateError() const { return nLastInflateError; }
+};
+
}
#endif