public static String serialize(Serializable obj) throws IOException { if (obj == null) { return ""; } try { ByteArrayOutputStream serialObj = new ByteArrayOutputStream(); ObjectOutputStream objStream = new ObjectOutputStream(serialObj); objStream.writeObject(obj); objStream.close(); return encodeBytes(serialObj.toByteArray()); } catch (Exception e) { throw new IOException("Serialization error: " + e.getMessage(), e); } }
public static String serialize(Serializable obj) throws IOException { if (obj == null) { return ""; } try { ByteArrayOutputStream serialObj = new ByteArrayOutputStream(); ObjectOutputStream objStream = new ObjectOutputStream(serialObj); objStream.writeObject(obj); objStream.close(); return encodeBytes(serialObj.toByteArray()); } catch (Exception e) { throw new IOException("Serialization error: " + e.getMessage(), e); } }
public static String serialize(Serializable obj) throws IOException { if (obj == null) { return ""; } try { ByteArrayOutputStream serialObj = new ByteArrayOutputStream(); ObjectOutputStream objStream = new ObjectOutputStream(serialObj); objStream.writeObject(obj); objStream.close(); return encodeBytes(serialObj.toByteArray()); } catch (Exception e) { throw new IOException("Serialization error: " + e.getMessage(), e); } }
public static String serialize(Serializable obj) throws IOException { if (obj == null) { return ""; } try { ByteArrayOutputStream serialObj = new ByteArrayOutputStream(); ObjectOutputStream objStream = new ObjectOutputStream(serialObj); objStream.writeObject(obj); objStream.close(); return encodeBytes(serialObj.toByteArray()); } catch (Exception e) { throw new IOException("Serialization error: " + e.getMessage(), e); } }
public static String serialize(Serializable obj) throws IOException { if (obj == null) { return ""; } try { ByteArrayOutputStream serialObj = new ByteArrayOutputStream(); ObjectOutputStream objStream = new ObjectOutputStream(serialObj); objStream.writeObject(obj); objStream.close(); return encodeBytes(serialObj.toByteArray()); } catch (Exception e) { throw new IOException("Serialization error: " + e.getMessage(), e); } }