(no commit message)
[utils] / support / general / src / main / java / org / wamblee / general / ObjectSerializationUtils.java
index 1b820f03dd08af1b5b09ab62d9229195b0347a71..db8534a9e81035884c3f0ee3a694139dc955c70b 100644 (file)
@@ -29,31 +29,38 @@ import java.io.ObjectOutputStream;
 public class ObjectSerializationUtils {
 
     /**
-     * Serialize an object to a byte array. 
-     * @param aObject Object ot serialize. 
+     * Serialize an object to a byte array.
+     * 
+     * @param aObject
+     *            Object ot serialize.
      * @return Byte array.
      * @throws IOException
      */
     public static byte[] serialize(Object aObject) throws IOException {
-        ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
         ObjectOutputStream os = new ObjectOutputStream(bos);
         os.writeObject(aObject);
         os.flush();
         return bos.toByteArray();
     }
-    
+
     /**
-     * Desrializes an object from a byte array. 
-     * @param <T> Type of the object.
-     * @param aData Serialized data.
-     * @param aType Type of the object.
-     * @return Object. 
+     * Desrializes an object from a byte array.
+     * 
+     * @param <T>
+     *            Type of the object.
+     * @param aData
+     *            Serialized data.
+     * @param aType
+     *            Type of the object.
+     * @return Object.
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    public static <T> T deserialize(byte[] aData, Class<T> aType) throws IOException, ClassNotFoundException { 
-        ByteArrayInputStream bis = new ByteArrayInputStream(aData); 
-        ObjectInputStream os = new ObjectInputStream(bis); 
-        return (T)os.readObject();
+    public static <T> T deserialize(byte[] aData, Class<T> aType)
+        throws IOException, ClassNotFoundException {
+        ByteArrayInputStream bis = new ByteArrayInputStream(aData);
+        ObjectInputStream os = new ObjectInputStream(bis);
+        return (T) os.readObject();
     }
 }