@ Nonnull public static < T > T getDeserializedObject ( @ Nonnull final byte [ ] aData ) { ValueEnforcer . notNull ( aData , "Data" ) ; // Read new object from byte array try ( final ObjectInputStream aOIS = new ObjectInputStream ( new NonBlockingByteArrayInputStream ( aData ) ) ) { return GenericReflection . uncheckedCast ( aOIS . readObject ( ) ) ; } catch ( final Exception ex ) { throw new IllegalStateException ( "Failed to read serializable object" , ex ) ; } }
Convert the passed byte array to an object using deserialization .