#vulnerable code 
                                @Override
    public byte[] getBlock(final long start, final int length) throws IOException {

        RandomAccessFile raf = null;
        boolean canThrow = false;
        try {
            raf = new RandomAccessFile(file, "r");

            // We include a separate check for int overflow.
            if ((start < 0) || (length < 0) || (start + length < 0)
                    || (start + length > raf.length())) {
                throw new IOException("Could not read block (block start: "
                        + start + ", block length: " + length
                        + ", data length: " + raf.length() + ").");
            }

            final byte[] ret = BinaryFunctions.getRAFBytes(raf, start, length,
                    "Could not read value from file");
            canThrow = true;
            return ret;
        } finally {
            IoUtils.closeQuietly(canThrow, raf);
        }
    } 
                            #location 22 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    public byte[] getBlock(final long start, final int length) throws IOException {
        try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
            // We include a separate check for int overflow.
            if ((start < 0) || (length < 0) || (start + length < 0)
                    || (start + length > raf.length())) {
                throw new IOException("Could not read block (block start: "
                        + start + ", block length: " + length
                        + ", data length: " + raf.length() + ").");
            }

            final byte[] ret = BinaryFunctions.getRAFBytes(raf, start, length,
                    "Could not read value from file");
            return ret;
        }
    }