@SuppressWarnings("Finally") // Not concerned about suppression; expected to be exceedingly rare
    private ByteString createBufferFromFile(String fileClassPath) {
        ByteString buffer = ByteString.EMPTY;
        final InputStream inputStream = getClass().getResourceAsStream(fileClassPath);
        if (inputStream == null) {
            throw new IllegalArgumentException("Unable to locate file on classpath: " + fileClassPath);
        }

        try {
            buffer = ByteString.readFrom(inputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                inputStream.close();
            } catch (IOException ignorable) {
                // ignore
            }
        }
        return buffer;
    }
Creates a buffer with data read from a file.
grpc/src/test/java/com/linecorp/armeria/internal/common/grpc/TestServiceImpl.java