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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
public static byte[] convertObjectToByteArray(Object obj) {
	java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
	java.io.ObjectOutputStream oos = null;
	try {
		oos = new java.io.ObjectOutputStream(baos);
		oos.writeObject(obj);
		oos.flush();
		oos.close();
	} catch (java.io.IOException ex) {
		Ts.printErr(ex);
	}
	return baos.toByteArray();
}
 
public static void printErr(java.lang.Exception ex) {
	printErr(ex.getMessage());
}


Back to JavaHowTo

Alumni Liaison

Abstract algebra continues the conceptual developments of linear algebra, on an even grander scale.

Dr. Paul Garrett