List of utility methods to do InputStream Save
File | saveTmpFile(InputStream is) save Tmp File File file = getTmpFile(); OutputStream os = new FileOutputStream(file); byte[] buf = new byte[1024]; int len = 0; while ((len = is.read(buf)) > 0) { os.write(buf, 0, len); os.flush(); ... |
void | toBase64OutputStream(InputStream is, OutputStream os) Convenience function to copy from inputstream to outputstream if (is == null) { return; OutputStream osb64 = null; try { osb64 = getBase64OutputStream(os); byte[] buf = new byte[1024]; int count = 0; ... |
void | toOutputStream(InputStream is, OutputStream os) Convenience function to copy from inputstream to outputstream if (is == null) { return; try { byte[] buf = new byte[1024]; int count = 0; while ((count = is.read(buf)) != -1) { os.write(buf, 0, count); ... |
void | doOutputFile(InputStream is, String filename) do Output File FileOutputStream os = new FileOutputStream(filename); BufferedOutputStream bos = new BufferedOutputStream(os, BUFFER_SIZE); int len; while ((len = is.read(buf, 0, BUFFER_SIZE)) > 0) { bos.write(buf, 0, len); bos.flush(); bos.close(); ... |
int | writeFile(File file, InputStream inStream) write File long dataSize = 0; DataInputStream in = null; DataOutputStream out = null; if (null != inStream && null != file) { try { byte buffer[] = new byte[BUFFER]; out = new DataOutputStream(new FileOutputStream(file)); in = new DataInputStream(inStream); ... |