Package com.zwl.util.zip.impl

Examples of com.zwl.util.zip.impl.ExtZipOutputStream


      AESDecrypter decrypter = new AESDecrypterBC( pwBytes, salt, pwVerification );

      // create tmp file to contains the decrypted, but still compressed data
      File tmpFile = new File( outFile.getPath() + "_TMP.zip" );
      makeDir( new File(tmpFile.getParent()) );
      ExtZipOutputStream zos = new ExtZipOutputStream( tmpFile );
      ExtZipEntry tmpEntry = new ExtZipEntry( zipEntry );
      tmpEntry.setPrimaryCompressionMethod( zipEntry.getMethod() );
      zos.putNextEntry( tmpEntry );

      raFile.seek( cde.getOffset() );
      byte[] buffer = new byte[bufferSize];
      int remaining = (int)zipEntry.getEncryptedDataSize();
      while( remaining>0 ) {
        int len = (remaining>buffer.length) ? buffer.length : remaining;
        int read = raFile.readByteArray(buffer,len);
        decrypter.decrypt( buffer, read );
        zos.writeBytes( buffer, 0, read );
        remaining -= len;
      }
      zos.finish();

      byte[] storedMac = new byte[10];
      raFile.readByteArray(storedMac,10);
      byte[] calcMac = decrypter.getFinalAuthentication();
      if( LOG.isLoggable(Level.FINE) ) {
View Full Code Here


   *
   * @param pathName
   *          to output zip file (aes encrypted zip file)
   */
  public AesZipFileEncrypter(String pathName) throws IOException {
    zipOS = new ExtZipOutputStream(new File(pathName));
  }
View Full Code Here

   *
   * @param outFile
   *          output file (aes encrypted zip file)
   */
  public AesZipFileEncrypter(File outFile) throws IOException {
    zipOS = new ExtZipOutputStream(outFile);
  }
View Full Code Here

TOP

Related Classes of com.zwl.util.zip.impl.ExtZipOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.