Example usage for com.fasterxml.jackson.core.util ByteArrayBuilder flush

List of usage examples for com.fasterxml.jackson.core.util ByteArrayBuilder flush

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core.util ByteArrayBuilder flush.

Prototype

@Override
    public void flush() 

Source Link

Usage

From source file:net.logstash.logback.composite.CompositeJsonFormatter.java

public byte[] writeEventAsBytes(Event event) throws IOException {
    ByteArrayBuilder outputStream = new ByteArrayBuilder(getBufferRecycler());

    try {/*from w  ww  .j  ava  2s .c o m*/
        writeEventToOutputStream(event, outputStream);
        outputStream.flush();
        return outputStream.toByteArray();
    } finally {
        outputStream.release();
    }
}