#fixed code
                                @Override
    public void writeTo(UncompressedBlock block,
            Class<?> type,
            Type genericType,
            Annotation[] annotations,
            MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders,
            OutputStream output)
            throws IOException, WebApplicationException
    {
        Slice slice = block.getSlice();

        new OutputStreamSliceOutput(output)
                .appendInt(slice.length())
                .appendInt(block.getCount())
                .appendLong(block.getRange().getStart())
                .appendBytes(slice);
    }
#vulnerable code 
                                @Override
    public void writeTo(UncompressedBlock block,
            Class<?> type,
            Type genericType,
            Annotation[] annotations,
            MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders,
            OutputStream output)
            throws IOException, WebApplicationException
    {
        Slice slice = block.getSlice();

        // write header
        ByteArraySlice header = Slices.allocate(SIZE_OF_INT + SIZE_OF_INT + SIZE_OF_LONG);
        header.output()
                .appendInt(slice.length())
                .appendInt(block.getCount())
                .appendLong(block.getRange().getStart());
        output.write(header.getRawArray());

        // write slice
        slice.getBytes(0, output, slice.length());
    } 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK