zip bundle fixed

This commit is contained in:
Honfika
2014-01-21 22:20:01 +01:00
parent e1f37eb0b6
commit fc92a2e5b5
10 changed files with 33 additions and 20 deletions
+14
View File
@@ -410,6 +410,20 @@ public class Helper {
return baos.toByteArray();
}
public static byte[] readStream(InputStream is) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
byte[] buf = new byte[4096];
int cnt = 0;
while ((cnt = is.read(buf)) > 0) {
baos.write(buf, 0, cnt);
}
} catch (IOException ex) {
Logger.getLogger(Helper.class.getName()).log(Level.SEVERE, null, ex);
}
return baos.toByteArray();
}
public static void writeFile(String file, byte[]... data) {
try (FileOutputStream fos = new FileOutputStream(file)) {
for (byte[] d : data) {