summaryrefslogtreecommitdiff
path: root/unotools/source/ucbhelper/xtempfile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/ucbhelper/xtempfile.cxx')
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 35462587ff84..7e27b7f4d24f 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -147,6 +147,21 @@ sal_Int32 SAL_CALL OTempFileService::readSomeBytes( css::uno::Sequence< sal_Int8
}
return readBytes(aData, nMaxBytesToRead);
}
+sal_Int32 OTempFileService::readSomeBytes( sal_Int8* aData, sal_Int32 nBytesToRead )
+{
+ std::unique_lock aGuard( maMutex );
+ if ( mbInClosed )
+ throw css::io::NotConnectedException ( OUString(), getXWeak() );
+
+ checkConnected();
+ if (nBytesToRead < 0)
+ throw css::io::BufferSizeExceededException( OUString(), getXWeak());
+
+ sal_uInt32 nRead = mpStream->ReadBytes(static_cast<void*>(aData), nBytesToRead);
+ checkError();
+
+ return nRead;
+}
void SAL_CALL OTempFileService::skipBytes( sal_Int32 nBytesToSkip )
{
std::unique_lock aGuard( maMutex );