Created
August 25, 2015 22:22
-
-
Save bigsnarfdude/2d81595460859966d0d3 to your computer and use it in GitHub Desktop.
custom java scala buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this section rewrites the each file byte by byte back to new zip file | |
while (e.hasMoreElements()) { | |
val entryIn = e.nextElement().asInstanceOf[ZipEntry] | |
if (!entryIn.getName.equalsIgnoreCase("abc.txt")) { | |
zos.putNextEntry(entryIn) | |
val is = zipFile.getInputStream(entryIn) | |
val buf = Array.ofDim[Byte](10) | |
var len: Int = 0 | |
while ((len = (is.read(buf))) > 0) { | |
zos.write(buf, 0, len) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment