private static HttpData toHttpData(@Nullable Object value) {
        if (value instanceof HttpData) {
            return (HttpData) value;
        }
        if (value instanceof byte[]) {
            return HttpData.wrap((byte[]) value);
        }
        if (value == null) {
            return HttpData.empty();
        }
        throw new IllegalStateException("Failed to convert an object to an HttpData: " +
                                        value.getClass().getName());
    }
A {@link ResponseConverterFunction} which creates an {@link HttpResponse} when:
<ul>
  <li>the {@code result} is an instance of {@link HttpData} or {@code byte[]}</li>
  <li>the {@code result} is an instance of {@link Publisher} or {@link Stream} while the
      {@code "content-type"} of the {@link ResponseHeaders} is {@code "application/binary"} or
      {@code "application/octet-stream"}</li>
</ul>
Note that this {@link ResponseConverterFunction} is applied to an annotated service by default,
so you don't have to specify this converter explicitly.
core/src/main/java/com/linecorp/armeria/server/annotation/ByteArrayResponseConverterFunction.java