public static void fromByteArray(Streamable streamable, byte[] array, int offset, int length) {
        try {
            final ByteArrayInputStream bais = new ByteArrayInputStream(array, offset, length);
            final DataInputStream dis = new DataInputStream(bais);
            streamable.read(dis);
            bais.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
public static void fromByteArray ( Streamable streamable , byte [ ] array , int offset , int length ) { try { final ByteArrayInputStream bais = new ByteArrayInputStream ( array , offset , length ) ; final DataInputStream dis = new DataInputStream ( bais ) ; streamable . read ( dis ) ; bais . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Reads a {@link Streamable}'s serialized contents from a byte array.

@param streamable The object whose contents are to be read.
@param array The array from which to read the serialized form.
@param offset The offset into the array from which to start reading the serialized form.
@param length The length of the serialized form to read from the array.