Search in sources :

Example 1 with ImgFileWriter

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

the class MDRFile method write.

public void write() {
    mdr15.release();
    ImgFileWriter writer = getWriter();
    writeSections(writer);
    // Now refresh the header
    position(0);
    getHeader().writeHeader(writer);
}
Also used : ImgFileWriter(uk.me.parabola.imgfmt.app.ImgFileWriter) FileBackedImgFileWriter(uk.me.parabola.imgfmt.app.FileBackedImgFileWriter)

Example 2 with ImgFileWriter

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

the class LBLFile method writePost.

public void writePost() {
    // Now that the body is written all the required offsets will be set up
    // inside the header, so we can go back and write it.
    ImgFileWriter writer = getWriter();
    getHeader().writeHeader(writer);
    // Text can be put between the header and the body of the file.
    writer.put(Utils.toBytes(sort.getDescription()));
    writer.put((byte) 0);
    assert writer.position() == LBLHeader.HEADER_LEN + lblHeader.getSortDescriptionLength();
}
Also used : BufferedImgFileWriter(uk.me.parabola.imgfmt.app.BufferedImgFileWriter) ImgFileWriter(uk.me.parabola.imgfmt.app.ImgFileWriter)

Example 3 with ImgFileWriter

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

the class DEMFile method write.

public void write() {
    ImgFileWriter w = getWriter();
    if (w instanceof BufferedImgFileWriter) {
        // increase file size limit to 256MB, no idea what the limit is
        ((BufferedImgFileWriter) w).setMaxSize(0xfffffff);
    }
    getHeader().writeHeader(getWriter());
}
Also used : BufferedImgFileWriter(uk.me.parabola.imgfmt.app.BufferedImgFileWriter) ImgFileWriter(uk.me.parabola.imgfmt.app.ImgFileWriter) BufferedImgFileWriter(uk.me.parabola.imgfmt.app.BufferedImgFileWriter)

Example 4 with ImgFileWriter

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

the class TREFile method writeCopyrights.

/**
 * Write out the copyrights.  This is just a list of pointers to strings
 * in the label section basically.
 */
private void writeCopyrights() {
    // Write out the pointers to the labels that hold the copyright strings
    header.setCopyrightPos(position());
    ImgFileWriter writer = getWriter();
    for (Label l : copyrights) {
        header.incCopyrightSize();
        writer.put3(l.getOffset());
    }
}
Also used : Label(uk.me.parabola.imgfmt.app.Label) BufferedImgFileWriter(uk.me.parabola.imgfmt.app.BufferedImgFileWriter) ImgFileWriter(uk.me.parabola.imgfmt.app.ImgFileWriter)

Example 5 with ImgFileWriter

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

the class NETFile method writePost.

/**
 * Final writing out of net sections.
 *
 * We patch the NET offsets into the RGN file and create the sorted roads section.
 *
 * @param rgn The region file, this has to be patched with the calculated net offsets.
 */
public void writePost(ImgFileWriter rgn) {
    for (RoadDef rd : roads) rd.writeRgnOffsets(rgn);
    ImgFileWriter writer = netHeader.makeSortedRoadWriter(getWriter());
    try {
        List<LabeledRoadDef> labeledRoadDefs = sortRoads();
        for (LabeledRoadDef labeledRoadDef : labeledRoadDefs) labeledRoadDef.roadDef.putSortedRoadEntry(writer, labeledRoadDef.label);
    } finally {
        Utils.closeFile(writer);
    }
    getHeader().writeHeader(getWriter());
}
Also used : BufferedImgFileWriter(uk.me.parabola.imgfmt.app.BufferedImgFileWriter) ImgFileWriter(uk.me.parabola.imgfmt.app.ImgFileWriter)

Aggregations

ImgFileWriter (uk.me.parabola.imgfmt.app.ImgFileWriter)13 BufferedImgFileWriter (uk.me.parabola.imgfmt.app.BufferedImgFileWriter)11 SectionWriter (uk.me.parabola.imgfmt.app.SectionWriter)7 Section (uk.me.parabola.imgfmt.app.Section)2 ArrayImgWriter (func.lib.ArrayImgWriter)1 Test (org.junit.Test)1 FileBackedImgFileWriter (uk.me.parabola.imgfmt.app.FileBackedImgFileWriter)1 Label (uk.me.parabola.imgfmt.app.Label)1 TypData (uk.me.parabola.imgfmt.app.typ.TypData)1 TypLine (uk.me.parabola.imgfmt.app.typ.TypLine)1