public T fromByteArray()

in serialization/src/main/java/com/twitter/serial/stream/legacy/LegacySerial.java [85:96]


    public <T> T fromByteArray(@Nullable byte[] bytes, @NotNull Serializer<T> serializer) throws IOException,
            ClassNotFoundException {
        if (bytes == null || bytes.length == 0) {
            return null;
        }
        try (ObjectInputStream objectInput = new ObjectInputStream(
            new ByteArrayInputStream(bytes))) {
            return serializer.deserialize(mContext, new LegacySerializerInput(objectInput));
        } catch (IOException | ClassNotFoundException | IllegalStateException e) {
            throw e;
        }
    }