INNER CODE UNIT · Java
BsonGenerator
michel-kraemer/bson4jackson · src/main/java/de/undercouch/bson4jackson/BsonGenerator.java:37
public class BsonGenerator extends GeneratorBase {
/**
* Defines toggable features
*/
public enum Feature {
/**
* <p>Enables streaming by setting the document's total
* number of bytes in the header to 0. This allows the generator
* to flush the output buffer from time to time. Otherwise the
* generator would have to buffer the whole file to be able to
* calculate the total number of bytes.</p>
* <p><b>ATTENTION:</b> By enabling this feature, the BSON document
* generated by this class will not be compatible to the
* specification! However, if you know what you are doing and
* if you know that the document will be read by a parser that
* ignores the total number of bytes anyway (like {@link BsonParser}
* or <code>org.bson.BSONDecoder</code> from the MongoDB Java Driver
* do) then this feature will be very useful.</p>