/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
byte buffer[] = new byte[4096]; int length = -1; while (true) { length = fis.read(buffer); if (length == -1){ break; } baos.write(buffer, 0, length); } fis.close(); return baos.toByteArray(); }