In Reading mode, will close the underlying ogg
file and free its resources.
In Writing mode, will write out the Info, Comment
Tags objects, and then the video and audio data.
540810
public void close() throws IOException {
        if (r != null) {
            r = null;
            ogg.close();
            ogg = null;
        }
        if (w != null) {
            // First, write the initial packet of each stream
            // Skeleton (if present) goes first, then video, then audio(s)
            OggPacketWriter sw = null;
            if (skeleton != null) {
                sw = ogg.getPacketWriter();
                sw.bufferPacket(skeleton.getFishead().write(), true);
            }

            w.bufferPacket(info.write(), true);

            for (OggAudioStreamHeaders audio : soundtrackWriters.keySet()) {
                OggPacketWriter aw = soundtrackWriters.get(audio);
                aw.bufferPacket(audio.getInfo().write(), true);
            }

            // Next, provide the rest of the skeleton information, to
            //  make it easy to work out what's what
            if (skeleton != null) {
                for (SkeletonFisbone bone : skeleton.getFisbones()) {
                    sw.bufferPacket(bone.write(), true);
                }
                for (SkeletonKeyFramePacket frame : skeleton.getKeyFrames()) {
                    sw.bufferPacket(frame.write(), true);
                }
            }

            // Next is the rest of the Theora headers
            w.bufferPacket(comments.write(), true);
            w.bufferPacket(setup.write(), true);

            // Finish the headers with the soundtrack stream remaining headers
            for (OggAudioStreamHeaders audio : soundtrackWriters.keySet()) {
                OggPacketWriter aw = soundtrackWriters.get(audio);
                aw.bufferPacket(audio.getTags().write(), true);
                if (audio.getSetup() != null) {
                    aw.bufferPacket(audio.getSetup().write(), true);
                }
            }

            // Write the audio visual data, along with their granules
            long lastGranule = 0;
            for (AudioVisualDataAndSid avData : writtenPackets) {
                OggPacketWriter avw = w;
                if (avData.sid != sid) {
                    avw = soundtrackWriters.get(avData.sid);
                }

                // Update the granule position as we go
                // TODO Is this the correct logic for multi-stream writing?
                if(avData.data.getGranulePosition() >= 0 &&
                        lastGranule != avData.data.getGranulePosition()) {
                    avw.flush();
                    lastGranule = avData.data.getGranulePosition();
                    avw.setGranulePosition(lastGranule);
                }

                // Write the data, flushing if needed
                avw.bufferPacket(avData.data.write());
                if(avw.getSizePendingFlush() > 16384) {
                    avw.flush();
                }
            }

            // Close down all our writers
            w.close();
            w = null;

            if (sw != null) {
                sw.close();
                sw = null;
            }
            for (OggPacketWriter aw : soundtrackWriters.values()) {
                aw.close();
            }

            ogg.close();
            ogg = null;
        }
    }
1035756
def cleanup_log_files(outputfile):
    """"""
    d = os.path.dirname(os.path.abspath(outputfile))
    logfiles = [f for f in os.listdir(d) if f.endswith('ogg.log')]
    for f in logfiles:
        os.remove(f)
1223436
def close(self):
        
        files = self.__dict__.get('files')
        for key, value in iter_multi_items(files or ()):
            value.close()
312522
def close(self) -> None:
        
        if self.underlying_stream:
            if self.using_stdout:
                sys.stdout = self.underlying_stream
            else:
                sys.stderr = self.underlying_stream
            self.underlying_stream = None
        if self.file:
            # Do NOT close the file; we don't own it.
            self.file = None
            log.debug("Finished copying {} to {}",
                      self.output_description, self.filename)
740038
public void close() throws IOException {
		System.out.println("Serialized "
				+ this.jsonSerializer.getEntityDocumentCount()
				+ " item documents to JSON file " + OUTPUT_FILE_NAME + ".");
		this.jsonSerializer.close();
	}
1360667
def end_output (self, **kwargs):
        """"""
        self.write_edges()
        self.end_graph()
        if self.has_part("outro"):
            self.write_outro()
        self.close_fileoutput()
1020492
def _Close(self):
    
    if not self._file_object_set_in_init:
      self._file_object.close()
      self._file_object = None

    self._compressed_data = b''
    self._uncompressed_data = b''
    self._decompressor = None
133675
@Override
  public void close() {
    unmap();
    writer.close();
    readers.forEach(reader -> reader.close());
    open = false;
  }
1051431
public void free()
    {
        m_bookmark = null;
        m_objectID = null;
        m_dataSource = null;
        m_objectSource = null;
        if (m_buffer != null)
        {
            m_buffer.free();
            m_buffer = null;
        } 
    }
458329
public void free()
    {
        if (this.getContentPane().getComponentCount() > 0)
            if (this.getContentPane().getComponent(0) instanceof BaseApplet)
                ((BaseApplet)this.getContentPane().getComponent(0)).free();
        this.dispose();
    }
1134627
protected function close_xml_writer() {
        if ($this->xmlwriter instanceof xml_writer) {
            $this->xmlwriter->stop();
        }
        unset($this->xmlwriter);
        $this->xmlwriter = null;
        $this->xmlfilename = null;
    }
496308
@Override
  public void close() throws IOException {
    if (mClosed) {
      return;
    }

    try {
      // This aborts the block if the block is not fully read.
      updateBlockWriter(mBlockMeta.getBlockSize());

      if (mUnderFileSystemInputStream != null) {
        mUfsInstreamManager.release(mUnderFileSystemInputStream);
        mUnderFileSystemInputStream = null;
      }

      if (mBlockWriter != null) {
        mBlockWriter.close();
      }

      mUfsResource.close();
    } finally {
      mClosed = true;
    }
  }
627841
public void close() {
        // getting a read lock will ensure all writes have finished
        // if we are really closing assume that we don't care about reads
        readLock.lock();
        try {
            if (container != null) {
                try {
                    container.close();
                    container = null;
                    log.info("Closed container");
                } catch (XmlException e) {
                    log.warn("close failed: " + e.getMessage(), e);
                }
            }

            if (manager != null) {
                try {
                    manager.close();
                    manager = null;
                    log.info("Closed manager");
                } catch (XmlException e) {
                    log.warn("close failed: " + e.getMessage(), e);
                }
            }
        } finally {
            readLock.unlock();
        }
    }
51795
def end_output (self, **kwargs):
        """"""
        self.xml_endtag(u"urlset")
        self.xml_end_output()
        self.close_fileoutput()
117642
def close(self):
        
        self._serial.write(b"@c")
        self._serial.read()
        self._serial.close()
1094811
@Override
  public void close() throws IOException {
    if (!closed) {
      objectOutputStream.close();
      fileOutputStream.close();
      closed = true;
    }
  }
1275067
def close (self):
        """"""
        if self._stream:
            values = ( self._total.nbytes,
                       self._total.npackets,
                       int( math.ceil(self._total.nseconds) ),
                       self._filename )

            if self._dryrun:
                msg = 'Would write %d bytes, %d packets, %d seconds to %s.'
            else:
                msg = 'Wrote %d bytes, %d packets, %d seconds to %s.'
                self._stream.close()

            log.info(msg % values)

            self._filename  = None
            self._startTime = None
            self._stream    = None
            self._total     = PCapFileStats(0, 0, 0)