Revision as of 04:09, 23 November 2010 by Han84 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
public static void convertByteArrayToFile(byte[] stream, String filename) {
	java.io.File f = new java.io.File(filename);
	java.io.FileOutputStream fos = null;
	try {
		fos = new java.io.FileOutputStream(f);
	} catch (java.io.FileNotFoundException ex) {
		Ts.printErr(ex);
	}
	try {
		fos.write(stream);
		fos.close();
	} catch (java.io.IOException ex) {
		Ts.printErr(ex);
	}
}
 
public static void printErr(java.lang.Exception ex) {
	printErr(ex.getMessage());
}


Back to JavaHowTo

Alumni Liaison

Questions/answers with a recent ECE grad

Ryne Rayburn