private function endDebugStream()
    {
        if (is_resource($this->debug_log_stream_handle)) {
            rewind($this->debug_log_stream_handle);
            $this->debugLog('E621 API Verbose HTTP Request output:' . PHP_EOL . stream_get_contents($this->debug_log_stream_handle) . PHP_EOL);
            fclose($this->debug_log_stream_handle);
            $this->debug_log_stream_handle = null;
        }
    }