public static Serializable deserialize ( final ByteBuf content ) throws Exception { byte [ ] serialized = new byte [ content . readableBytes ( ) ] ; content . getBytes ( 0 , serialized ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( serialized ) ; ObjectInputStream is = new ObjectInputStream ( bis ) ; Serializable deserialized = ( Serializable ) is . readObject ( ) ; is . close ( ) ; bis . close ( ) ; return deserialized ; }
Takes the input content and deserializes it .