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

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

            // write slice
            slice.getBytes(0, output, slice.length());
        }
    } 
                            #location 19 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    public void writeTo(List<UncompressedBlock> blocks,
            Class<?> type,
            Type genericType,
            Annotation[] annotations,
            MediaType mediaType,
            MultivaluedMap<String, Object> httpHeaders,
            OutputStream output)
            throws IOException, WebApplicationException
    {
        OutputStreamSliceOutput sliceOutput = new OutputStreamSliceOutput(output);
        for (UncompressedBlock block : blocks) {
            Slice slice = block.getSlice();
            sliceOutput.appendInt(slice.length())
                    .appendInt(block.getCount())
                    .appendLong(block.getRange().getStart())
                    .appendBytes(slice)
                    .flush();
        }
    }