public static Location calculateDecodedCharLocation(final long byteOffset) {

        if (byteOffset < 0) {
            throw new IllegalArgumentException(LogUtil.message("Invalid byteOffset {}. Must be >= 0", byteOffset));
        }

        final int lineNo = (int) (byteOffset / HexDump.MAX_BYTES_PER_LINE + 1); // one based
        final int byteOffsetOnLine = (int) (byteOffset % HexDump.MAX_BYTES_PER_LINE);
        final int blockOffsetOnLine = byteOffsetOnLine / BYTES_PER_BLOCK;
        final int colNo = DECODED_CHARS_START_COL + byteOffsetOnLine;

        LOGGER.debug("lineNo: {}, colNo: {}, byteOffsetOnLine: {}, blockOffsetOnLine: {}",
                lineNo, colNo, byteOffsetOnLine, blockOffsetOnLine);

        return DefaultLocation.of(lineNo, colNo);
    }
Calculates the line/col position (in the rendered hex dump) of a given byte offset.
The line/col position is of the decoded char (in the right-hand column) corresponding to the
given byte offset.
This method knows nothing about the hex dump in question so if byteOffset is greater
than the number of bytes in the dump then the returned {@link Location} will also
be invalid. It also assumes that whatever is displaying the hex dump is showing all of it
up to and including this byte or is only showing some but has had its line numbers adjusted
accordingly.
stroom-util/src/main/java/stroom/util/string/HexDumpUtil.java