Search in sources :

Example 11 with SectionWriter

use of uk.me.parabola.imgfmt.app.SectionWriter in project mkgmap by openstreetmap.

the class TYPFile method writeStrIndex.

private void writeStrIndex(ImgFileWriter in) {
    SectionWriter writer = header.getStringIndex().makeSectionWriter(in);
    int psize = Utils.numberToPointerSize(header.getLabels().getSize());
    header.getStringIndex().setItemSize((char) (3 + psize));
    for (Map.Entry<Integer, Integer> ent : strToType.entrySet()) {
        writer.putN(psize, ent.getKey());
        writer.put3(ent.getValue());
    }
    Utils.closeFile(writer);
}
Also used : SectionWriter(uk.me.parabola.imgfmt.app.SectionWriter) TreeMap(java.util.TreeMap) Map(java.util.Map)

Aggregations

SectionWriter (uk.me.parabola.imgfmt.app.SectionWriter)11 BufferedImgFileWriter (uk.me.parabola.imgfmt.app.BufferedImgFileWriter)7 ImgFileWriter (uk.me.parabola.imgfmt.app.ImgFileWriter)7 CharsetEncoder (java.nio.charset.CharsetEncoder)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 Section (uk.me.parabola.imgfmt.app.Section)2 ByteBuffer (java.nio.ByteBuffer)1 CharBuffer (java.nio.CharBuffer)1 CharacterCodingException (java.nio.charset.CharacterCodingException)1 ArrayList (java.util.ArrayList)1 Sort (uk.me.parabola.imgfmt.app.srt.Sort)1 SortKey (uk.me.parabola.imgfmt.app.srt.SortKey)1