public static byte[] bytesOf(Object obj) {
		try {
			ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
			ObjectOutputStream oos = new ObjectOutputStream(byteOut);
			oos.writeObject(obj);
			
			return byteOut.toByteArray();
		}
		catch(IOException e) {
			e.printStackTrace();
			return null;
		}
	}