summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/file/filinpstr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/file/filinpstr.cxx')
-rw-r--r--ucb/source/ucp/file/filinpstr.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index 70e80e384d2b..33cbf32d1df6 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -99,6 +99,24 @@ XInputStream_impl::readBytes(
return static_cast<sal_Int32>(nrc);
}
+sal_Int32
+XInputStream_impl::readSomeBytes(
+ sal_Int8* aData,
+ sal_Int32 nBytesToRead )
+{
+ if( ! m_nIsOpen ) throw io::IOException( THROW_WHERE );
+
+ //TODO! translate memory exhaustion (if it were detectable...) into
+ // io::BufferSizeExceededException
+
+ sal_uInt64 nrc(0);
+ if(m_aFile.read( aData, sal_uInt64(nBytesToRead),nrc )
+ != osl::FileBase::E_None)
+ throw io::IOException( THROW_WHERE );
+
+ return static_cast<sal_Int32>(nrc);
+}
+
sal_Int32 SAL_CALL
XInputStream_impl::readSomeBytes(
uno::Sequence< sal_Int8 >& aData,