@Override public void close() throws IOException { if (!isClosed()) { _emitter.emit(new DocumentEndEvent(null, null, false)); _emitter.emit(new StreamEndEvent(null, null)); super.close(); /* 25-Nov-2008, tatus: As per [JACKSON-16] we are not to call close() * on the underlying Reader, unless we "own" it, or auto-closing * feature is enabled. * One downside: when using UTF8Writer, underlying buffer(s) * may not be properly recycled if we don't close the writer. */ if (_writer != null) { if (_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) { _writer.close(); } else if (isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM)) { // If we can't close it, we should at least flush _writer.flush(); } } } }
@Override public void close() throws IOException { if (!isClosed()) { _emitter.emit(new DocumentEndEvent(null, null, false)); _emitter.emit(new StreamEndEvent(null, null)); super.close(); /* 25-Nov-2008, tatus: As per [JACKSON-16] we are not to call close() * on the underlying Reader, unless we "own" it, or auto-closing * feature is enabled. * One downside: when using UTF8Writer, underlying buffer(s) * may not be properly recycled if we don't close the writer. */ if (_writer != null) { if (_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) { _writer.close(); } else if (isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM)) { // If we can't close it, we should at least flush _writer.flush(); } } } }
@Override public void close() throws IOException { out.write(builder.slice().getBuffer()); super.close(); } }
@Override public void close() throws IOException { //finish document if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) { while (_currentDocument != null) { writeEndObject(); } } //write buffer to output stream (if streaming is enabled, //this will write the the rest of the buffer) _buffer.writeTo(_out); _buffer.clear(); _out.flush(); if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) { _out.close(); } super.close(); }
@Override public void close() throws IOException { //finish document if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) { while (_currentDocument != null) { writeEndObject(); } } //write buffer to output stream (if streaming is enabled, //this will write the the rest of the buffer) _buffer.writeTo(_out); _buffer.clear(); _out.flush(); if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) { _out.close(); } super.close(); }
@Override public void close() throws IOException { //finish document if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) { while (_currentDocument != null) { writeEndObject(); } } //write buffer to output stream (if streaming is enabled, //this will write the the rest of the buffer) _buffer.writeTo(_out); _buffer.clear(); _out.flush(); if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) { _out.close(); } super.close(); }
@Override public void close() throws IOException { super.close(); // Let's mark row as closed, if we had any... finishRow(); _writer.close(_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)); }
@Override public void close() throws IOException { super.close(); // Let's mark row as closed, if we had any... finishRow(); // Write the header if necessary, occurs when no rows written if (_handleFirstLine) { _handleFirstLine(); } _writer.close(_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)); }
@Override public void close() throws IOException { if (!isClosed()) { _emitter.emit(new DocumentEndEvent(null, null, false)); _emitter.emit(new StreamEndEvent(null, null)); super.close(); /* 25-Nov-2008, tatus: As per [JACKSON-16] we are not to call close() * on the underlying Reader, unless we "own" it, or auto-closing * feature is enabled. * One downside: when using UTF8Writer, underlying buffer(s) * may not be properly recycled if we don't close the writer. */ if (_writer != null) { if (_ioContext.isResourceManaged() || isEnabled(StreamWriteFeature.AUTO_CLOSE_TARGET)) { _writer.close(); } else if (isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM)) { // If we can't close it, we should at least flush _writer.flush(); } } } }
@Override public void close() throws IOException { super.close(); // Let's mark row as closed, if we had any... finishRow(); // Write the header if necessary, occurs when no rows written if (_handleFirstLine) { _handleFirstLine(); } _writer.close(_ioContext.isResourceManaged() || isEnabled(StreamWriteFeature.AUTO_CLOSE_TARGET), isEnabled(StreamWriteFeature.FLUSH_PASSED_TO_STREAM)); }
@Override public void close() throws IOException { // First: let's see that we still have buffers... if ((_outputBuffer != null) && isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) { while (true) { JsonStreamContext ctxt = getOutputContext(); if (ctxt.inArray()) { writeEndArray(); } else if (ctxt.inObject()) { writeEndObject(); } else { break; } } } // boolean wasClosed = _closed; super.close(); _flushBuffer(); if (_ioContext.isResourceManaged() || isEnabled(JsonGenerator.Feature.AUTO_CLOSE_TARGET)) { _out.close(); } else { // If we can't close it, we should at least flush _out.flush(); } // Internal buffer(s) generator has can now be released as well _releaseBuffers(); }
super.close(); _flushBuffer();
@Override public void close() throws IOException super.close(); if (isEnabled(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT)) { ProtobufWriteContext ctxt;
@Override public void close() throws IOException super.close(); if (isEnabled(StreamWriteFeature.AUTO_CLOSE_CONTENT)) { ProtobufWriteContext ctxt;
throws IOException super.close();
throws IOException super.close();
super.close();