Code example for ObjectOutputStream

Methods: close, writeObject

0
	 *  
	 */ 
	public static byte[] ObjectToByte(Object obj) throws IOException {
		try { 
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			ObjectOutputStream outputStream = new ObjectOutputStream(out);
			outputStream.writeObject(obj);
			byte[] bytes = out.toByteArray();
			outputStream.close();
			return bytes;
		} catch (Exception e) {
			System.out.println(" ObjectToBlob ");
			return null; 
		} 
	} 
 
	/* 
	 *  
	 */ 
	public static Object ByteToObject(byte[] bytes) throws IOException {
		try {