Search in sources :

Example 41 with IOContext

use of com.fasterxml.jackson.core.io.IOContext in project bson4jackson by michel-kraemer.

the class BsonFactory method createGenerator.

@Override
public BsonGenerator createGenerator(File f, JsonEncoding enc) throws IOException {
    OutputStream out = new FileOutputStream(f);
    IOContext ctxt = _createContext(out, true);
    ctxt.setEncoding(enc);
    if (enc == JsonEncoding.UTF8 && _outputDecorator != null) {
        out = _outputDecorator.decorate(ctxt, out);
    }
    return createGenerator(out, enc);
}
Also used : OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) FileOutputStream(java.io.FileOutputStream) IOContext(com.fasterxml.jackson.core.io.IOContext)

Aggregations

IOContext (com.fasterxml.jackson.core.io.IOContext)41 BufferRecycler (com.fasterxml.jackson.core.util.BufferRecycler)28 BaseTest (com.fasterxml.jackson.core.BaseTest)18 Test (org.junit.Test)18 ByteQuadsCanonicalizer (com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer)8 UTF8Writer (com.fasterxml.jackson.core.io.UTF8Writer)5 BsonBinaryReader (org.bson.BsonBinaryReader)5 BsonBinaryWriter (org.bson.BsonBinaryWriter)5 BasicOutputBuffer (org.bson.io.BasicOutputBuffer)5 BsonWriter (org.bson.BsonWriter)4 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 InputStream (java.io.InputStream)3 JsonParser (com.fasterxml.jackson.core.JsonParser)2 ReaderBasedJsonParser (com.fasterxml.jackson.core.json.ReaderBasedJsonParser)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 UnsafeByteArrayInputStream (de.undercouch.bson4jackson.io.UnsafeByteArrayInputStream)2 FileInputStream (java.io.FileInputStream)2 OutputStream (java.io.OutputStream)2 BsonDocument (org.bson.BsonDocument)2 JsonFactory (com.fasterxml.jackson.core.JsonFactory)1