// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempStorage, "SubStream1", "MediaType1", true, pBytes ) ) returnfalse;
// open a new substorage
XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage, "SubStorage1",
ElementModes.WRITE ); if ( xTempSubStorage == null )
{
m_aTestHelper.Error( "Can't create substorage!" ); returnfalse;
}
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream2", "MediaType2", true, pBytes ) ) returnfalse;
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage, "MediaType3", true,
ElementModes.WRITE ) ) returnfalse;
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage, "MediaType4", false,
ElementModes.WRITE ) ) returnfalse;
// commit substorage first if ( !m_aTestHelper.commitStorage( xTempSubStorage ) ) returnfalse;
// commit the root storage so the contents must be stored now if ( !m_aTestHelper.commitStorage( xTempStorage ) ) returnfalse;
// dispose used storage to free resources if ( !m_aTestHelper.disposeStorage( xTempStorage ) ) returnfalse;
// now reopen the storage, and insert a new stream
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes if ( !m_aTestHelper.WriteBytesToSubstream( xStep2TempStorage, "SubStream3", "MediaType5", true, pBytes ) ) returnfalse;
// commit the root storage so the contents must be stored now if ( !m_aTestHelper.commitStorage( xStep2TempStorage ) ) returnfalse;
// dispose used storage to free resources if ( !m_aTestHelper.disposeStorage( xStep2TempStorage ) ) returnfalse;
// now access the stream using ZipInputStream
URI aUri = new URI( sTempFileURL );
File aFile = new File( aUri );
FileInputStream aFileStream = new FileInputStream( aFile );
ZipInputStream aZipStream = new ZipInputStream( aFileStream );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.