public byte getValue(long pos)
    {
        try {
            content.get(ByteBuffer.wrap(tmpRawBuffer, 0, 1), null, pos);
        } catch (IOException e) {
            log.warn(e);
        }
        return tmpRawBuffer[0];
    }
Get caret position in file, which can be out of view

@return the current caret position
plugins/org.jkiss.dbeaver.ui.editors.hex/src/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java