Example usage for com.fasterxml.jackson.databind SequenceWriter write

List of usage examples for com.fasterxml.jackson.databind SequenceWriter write

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind SequenceWriter write.

Prototype

public SequenceWriter write(Object value) throws IOException 

Source Link

Document

Method for writing given value into output, as part of sequence to write.

Usage

From source file:org.teavm.libgdx.plugin.AssetsCopier.java

private void writeJsonFS(OutputStream output) throws IOException {
    SequenceWriter seqWriter = writer.writeValues(output);
    boolean first = true;
    output.write((byte) '[');
    for (FileDescriptor desc : rootFileDescriptor.getChildFiles()) {
        if (!first) {
            output.write((byte) ',');
        }/*from ww  w . ja v  a 2s . c  o  m*/
        first = false;
        seqWriter.write(desc);
    }
    output.write((byte) ']');
    seqWriter.flush();
}

From source file:org.apache.hyracks.maven.license.GenerateFileMojo.java

private void persistLicenseMap() throws IOException {
    if (licenseMapOutputFile != null) {
        licenseMapOutputFile.getParentFile().mkdirs();
        SequenceWriter sw = new ObjectMapper().writerWithDefaultPrettyPrinter()
                .writeValues(licenseMapOutputFile).init(true);
        for (LicensedProjects entry : licenseMap.values()) {
            sw.write(entry);
        }/*from w  w w.  ja  v a2  s.  c  o  m*/
        sw.close();
    }
}