summaryrefslogtreecommitdiff
path: root/package/source/zipapi/ZipFile.cxx
diff options
context:
space:
mode:
authorMartin Gallwey <mtg@openoffice.org>2001-12-04 16:45:30 +0000
committerMartin Gallwey <mtg@openoffice.org>2001-12-04 16:45:30 +0000
commitb8954b7df90c9904d7cf2c1e859ce95d9fc754e8 (patch)
tree7a1dcea72303360b20b30cb635e1cbbaf0005090 /package/source/zipapi/ZipFile.cxx
parent6de8fbbd27dfb4b69bce1b51eb3cd48abf3215db (diff)
#95155# add support for unbuffered streams
Diffstat (limited to 'package/source/zipapi/ZipFile.cxx')
-rw-r--r--package/source/zipapi/ZipFile.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 8e3c0dc4f3dc..3a35b1624931 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipFile.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: mtg $ $Date: 2001-11-15 20:22:18 $
+ * last change: $Author: mtg $ $Date: 2001-12-04 17:45:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,6 +76,9 @@
#ifndef _XMEMORY_STREAM_HXX
#include <XMemoryStream.hxx>
#endif
+#ifndef _XUNBUFFERED_STREAM_HXX
+#include <XUnbufferedStream.hxx>
+#endif
#ifndef _XFILE_STREAM_HXX
#include <XFileStream.hxx>
#endif
@@ -411,6 +414,15 @@ Reference < XInputStream > ZipFile::createMemoryStream(
}
return Reference < XInputStream > ( new XMemoryStream ( aWriteBuffer ) );
}
+Reference < XInputStream > ZipFile::createUnbufferedStream(
+ ZipEntry & rEntry,
+ const ORef < EncryptionData > &rData,
+ sal_Bool bRawStream,
+ sal_Bool bIsEncrypted )
+{
+ return new XUnbufferedStream ( rEntry, xStream, rData, bRawStream, bIsEncrypted );
+}
+
ZipEnumeration * SAL_CALL ZipFile::entries( )
{
@@ -447,9 +459,12 @@ Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
if ( bIsEncrypted && !rData.isEmpty() && rData->aDigest.getLength() )
bNeedRawStream = !hasValidPassword ( rEntry, rData );
+ return createUnbufferedStream ( rEntry, rData, bNeedRawStream, bIsEncrypted );
+ /*
return rEntry.nSize > n_ConstMaxMemoryStreamSize ?
createFileStream ( rEntry, rData, bNeedRawStream, bIsEncrypted ) :
createMemoryStream ( rEntry, rData, bNeedRawStream, bIsEncrypted);
+ */
//return createMemoryStream( rEntry, rData, sal_False );
}
@@ -462,9 +477,12 @@ Reference< XInputStream > SAL_CALL ZipFile::getRawStream( ZipEntry& rEntry,
if ( rEntry.nOffset <= 0 )
readLOC( rEntry );
+ return createUnbufferedStream ( rEntry, rData, sal_True, bIsEncrypted );
+ /*
return ( rEntry.nMethod == DEFLATED ? rEntry.nCompressedSize : rEntry.nSize > n_ConstMaxMemoryStreamSize ) ?
createFileStream ( rEntry, rData, sal_True, bIsEncrypted ) :
createMemoryStream ( rEntry, rData, sal_True, bIsEncrypted );
+ */
//return createMemoryStream( rEntry, rData, sal_True );
}