INNER CODE UNIT · Java
flush
michel-kraemer/bson4jackson · src/main/java/de/undercouch/bson4jackson/BsonGenerator.java:257
public void flush() {
try {
// we must not flush the buffer if we are currently writing a document
// otherwise we cannot write the document size to the header at the end
if (_currentDocument == null) {
_buffer.writeTo(_out);
_buffer.clear();
}
_out.flush();
} catch (IOException e) {
throw _wrapIOFailure(e);
}
}
@Override
protected void _releaseBuffers() {
_buffer.clear();
}