26#include <com/sun/star/io/IOException.hpp>
27#include <com/sun/star/io/XInputStream.hpp>
28#include <com/sun/star/io/XOutputStream.hpp>
29#include <com/sun/star/io/XSeekable.hpp>
31#include <osl/diagnose.h>
83 inline bool isEOF()
const;
89 : m_pFirstPage( nullptr )
90 , m_pReadPage( nullptr )
91 , m_pWritePage( nullptr )
92 , m_pReadBuffer( nullptr )
93 , m_nReadBufferSize( 0 )
94 , m_nReadBufferFilled( 0 )
145 sal_uInt32 nRead = 0;
154 catch (
const io::IOException&)
165 std::min(std::size_t(nSize - nRead),
166 std::size_t(std::numeric_limits<sal_Int32>::max())));
169 uno::Sequence< sal_Int8 >
aBuffer;
175 catch (
const io::IOException&)
196 if (nRead < nSize && !m_pPipe->isEOF())
202 std::size_t(nSize - nRead),
203 std::size_t(std::numeric_limits<sal_Int32>::max())));
206 uno::Sequence< sal_Int8 >
aBuffer;
212 catch (
const io::IOException&)
265 catch (
const io::IOException&)
287 catch (
const io::IOException&)
300 uno::Sequence< sal_Int8 >
aBuffer;
333 catch (
const io::IOException&)
356 std::size_t nWritten = 0;
361 std::min(std::size_t(nSize - nWritten),
362 std::size_t(std::numeric_limits<sal_Int32>::max())));
367 m_xStream->writeBytes(uno::Sequence< sal_Int8 >(
372 catch (
const io::IOException&)
401 catch (
const io::IOException&)
427 catch (
const io::IOException&)
510 return nSize - nRemain;
521 =
static_cast< Page *
>(std::malloc(
sizeof (
Page)
535 sal_uInt32 nRemain = nSize;
540 sal_uInt32 nBlock = std::min(nRemain,
547 nBlock = *
m_aMarks.begin() > nPosition ?
548 std::min(nBlock, sal_uInt32(*
m_aMarks.begin()
587 if (
m_nPages == std::numeric_limits< sal_uInt32 >::max())
591 =
static_cast< Page *
>(std::malloc(
626 while (nPosition < m_pReadPage->m_nOffset)
sal_uInt32 m_nReadBufferFilled
void write(sal_Int8 const *pBuffer, sal_uInt32 nSize)
std::multiset< sal_uInt32 > m_aMarks
sal_uInt32 m_nReadBufferSize
SeekResult setReadPosition(sal_uInt32 nPosition)
static const sal_uInt32 m_nPageSize
void setReadBuffer(sal_Int8 *pBuffer, sal_uInt32 nSize)
SvOutputStream(css::uno::Reference< css::io::XOutputStream > xTheStream)
virtual SVL_DLLPRIVATE void FlushData() override
virtual ~SvOutputStream() override
virtual SVL_DLLPRIVATE std::size_t PutData(void const *pData, std::size_t nSize) override
virtual SVL_DLLPRIVATE sal_uInt64 SeekPos(sal_uInt64) override
css::uno::Reference< css::io::XOutputStream > m_xStream
virtual SVL_DLLPRIVATE std::size_t GetData(void *, std::size_t) override
virtual SVL_DLLPRIVATE void SetSize(sal_uInt64) override
void SetBufferSize(sal_uInt16 m_nBufSize)
void SetError(ErrCode nErrorCode)
#define ERRCODE_IO_INVALIDDEVICE
#define ERRCODE_IO_CANTREAD
#define ERRCODE_IO_CANTSEEK
#define ERRCODE_IO_CANTWRITE
#define ERRCODE_IO_NOTSUPPORTED
std::unique_ptr< sal_Int32[]> pData
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
#define STREAM_SEEK_TO_END
Reference< XStream > m_xStream
std::unique_ptr< char[]> aBuffer