diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-09-25 14:45:55 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-10-23 11:53:15 +0200 |
commit | cc3ac382a2827a42d45f3fcb5e2149c163667ba0 (patch) | |
tree | b4c7fd6c7fb0f86b32a495bffb1200f804c2ef83 /include | |
parent | 8cc5b621aa308de2272bed32bc8cd88626455831 (diff) |
FastSerializer: Do not keep whole sequence in memory; write in chunks
Change-Id: Ibca65a2b8397358ac4013c8e5b53389ac6949e4d
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/seqstream.hxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx index 13dd4dc42550..75b19343299c 100644 --- a/include/comphelper/seqstream.hxx +++ b/include/comphelper/seqstream.hxx @@ -115,13 +115,16 @@ public: virtual ~OSequenceOutputStream() { if (m_bConnected) closeOutput(); } + sal_Int32 getSize() const { return m_nSize; } + /// same as XOutputStream::writeBytes (as expected :) virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - /// this is a dummy in this implementation, no buffering is used + /** Resizes the sequence used for writing to the really used size. + * Next time, writeBytes will write to the beginning of the sequence. + */ virtual void SAL_CALL flush( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - /** closes the output stream. In the case of this class, this means that the sequence used for writing is - resized to the really used size and not used any further, every subsequent call to one of the XOutputStream - methods will throw a <code>NotConnectedException</code>. + /** Calls flush() and closes the output stream to prevent further manipulation with the sequence. + Every subsequent call to one of the XOutputStream methods will throw a <code>NotConnectedException</code>. */ virtual void SAL_CALL closeOutput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; }; |