コード例 #1
0
 @Override
 public void close() throws IOException {
   _flushBuffer();
   /* 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 (_ioContext.isResourceManaged() || isFeatureEnabled(Feature.AUTO_CLOSE_TARGET)) {
     _writer.close();
   } else {
     // If we can't close it, we should at least flush
     _writer.flush();
   }
   // Internal buffer(s) generator has can now be released as well
   _releaseBuffers();
 }
コード例 #2
0
 @Override
 public final void flush() throws IOException {
   _flushBuffer();
   _writer.flush();
 }