@Nullable
    private HttpResponse read(Executor fileReadExecutor, ByteBufAllocator alloc,
                              @Nullable HttpFileAttributes attrs) {
        final ResponseHeaders headers = readHeaders(attrs);
        if (headers == null) {
            return null;
        }

        assert attrs != null;
        final long length = attrs.length();
        if (length == 0) {
            // No need to stream an empty file.
            return HttpResponse.of(headers);
        }

        try {
            return doRead(headers, length, fileReadExecutor, alloc);
        } catch (IOException e) {
            return Exceptions.throwUnsafely(e);
        }
    }
Generates the {@link ResponseHeaders} from the specified {@link HttpFileAttributes}.

@return the {@link ResponseHeaders}, or {@code null} if {@code attrs} is {@code null}.
core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFile.java