summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-09-08 15:13:01 +0000
committerOliver Bolte <obo@openoffice.org>2004-09-08 15:13:01 +0000
commit9e8912366419218069a3b245eebf2021359a5dea (patch)
treef068937ffac1a3daf3d684c0ae5df5c295a1f0a6 /configmgr
parentec73e7e35848aa57049ebe9cc9455076f4a60236 (diff)
INTEGRATION: CWS getfilesize1 (1.3.52); FILE MERGED
2004/08/24 13:15:06 cmc 1.3.52.1: #i33340# use osl_getFileSize instead of seeking to end and back to get length
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/backend/binaryreader.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/configmgr/source/backend/binaryreader.cxx b/configmgr/source/backend/binaryreader.cxx
index 15a4272e719b..ae26604f78f0 100644
--- a/configmgr/source/backend/binaryreader.cxx
+++ b/configmgr/source/backend/binaryreader.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: binaryreader.cxx,v $
*
-* $Revision: 1.3 $
+* $Revision: 1.4 $
*
-* last change: $Author: rt $ $Date: 2003-10-06 14:44:48 $
+* last change: $Author: obo $ $Date: 2004-09-08 16:13:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -253,7 +253,7 @@ namespace configmgr
OUString sMsg = OUString::createFromAscii("Cannot allocate Buffer: Too large");
throw io:: BufferSizeExceededException(sMsg, NULL);
}
- // --------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
BinaryReader_Impl::BinaryReader_Impl (rtl::OUString const & rFileUrl)
SAL_THROW( (io::IOException, uno::RuntimeException) )
: m_pBuffer (0)
@@ -263,18 +263,12 @@ namespace configmgr
osl::File aFile (rFileUrl);
checkIOError( aFile.open (OpenFlag_Read) );
-
- checkIOError( aFile.setPos (Pos_End, 0) );
-
sal_uInt64 nLength = 0;
- checkIOError( aFile.getPos (nLength) );
+ checkIOError( aFile.getSize (nLength) );
if (nLength > 0xffffffff)
raiseBufferError();
-
m_nLength = sal_uInt32(nLength);
- checkIOError( aFile.setPos (Pos_Absolut, 0) );
-
sal_uInt8 *pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory (m_nLength));
if (!pBuffer)
raiseBufferError();