public T fromByteArray()

in serialization/src/main/java/com/twitter/serial/stream/bytebuffer/ByteBufferSerial.java [101:114]


    public <T> T fromByteArray(@Nullable byte[] bytes, @NotNull Serializer<T> serializer)
            throws IOException,
            ClassNotFoundException {
        if (bytes == null || bytes.length == 0) {
            return null;
        }
        final SerializerInput serializerInput = new ByteBufferSerializerInput(bytes);
        try {
            return serializer.deserialize(mContext, serializerInput);
        } catch (IOException | ClassNotFoundException | IllegalStateException e) {
            throw new SerializationException("Invalid serialized data:\n" +
                    SerializationUtils.dumpSerializedData(bytes, serializerInput.getPosition(), mContext.isDebug()), e);
        }
    }