private static HttpData toProtobuf(Object message) {
        if (!(message instanceof Message)) {
            throw new IllegalStateException(
                    "Unexpected message type : " + message.getClass() + " (expected: a subtype of " +
                    Message.class.getName() + ')');
        }

        try {
            final Message cast = (Message) message;
            return HttpData.wrap(cast.toByteArray());
        } catch (Exception e) {
            return Exceptions.throwUnsafely(e);
        }
    }
Creates an instance with the specified {@link Printer}.
protobuf/src/main/java/com/linecorp/armeria/server/protobuf/ProtobufResponseConverterFunction.java