public MicroCache createMicroCache(final int lonIdx, final int latIdx, final DataBuffers dataBuffers, final TagValueValidator wayValidator,
                                       final WaypointMatcher waypointMatcher, final boolean reallyDecode, final OsmNodesMap hollowNodes) throws IOException {
        final int subIdx = (latIdx - divisor * latDegree) * divisor + (lonIdx - divisor * lonDegree);

        byte[] ab = dataBuffers.iobuffer;
        int asize = getDataInputForSubIdx(subIdx, ab);

        if (asize == 0) {
            return MicroCache.emptyCache();
        }
        if (asize > ab.length) {
            ab = new byte[asize];
            asize = getDataInputForSubIdx(subIdx, ab);
        }

        final StatCoderContext bc = new StatCoderContext(ab);

        try {
            if (!reallyDecode) {
                return null;
            }
            if (hollowNodes == null) {
                return new MicroCache2(bc, dataBuffers, lonIdx, latIdx, divisor, wayValidator, waypointMatcher);
            }
            new DirectWeaver(bc, dataBuffers, lonIdx, latIdx, divisor, wayValidator, waypointMatcher, hollowNodes);
            return MicroCache.emptyNonVirgin;
        } finally {
            // crc check only if the buffer has not been fully read
            final int readBytes = (bc.getReadingBitPosition() + 7) >> 3;
            if (readBytes != asize - 4) {
                final int crcData = Crc32Utils.crc(ab, 0, asize - 4);
                final int crcFooter = new ByteDataReader(ab, asize - 4).readInt();
                if (crcData == crcFooter) {
                    throw new IOException("old, unsupported data-format");
                } else if ((crcData ^ 2) != crcFooter) {
                    throw new IOException("checkum error");
                }
            }
        }
    }
cache for a single square

@author ab
main/src/main/java/cgeo/geocaching/brouter/mapaccess/OsmFile.java