func (w *responseWriter) WriteHeader(statusCode int) {
	w.statusCode = statusCode
}
WriteHeader sends an HTTP response header with status code.
If WriteHeader is not called explicitly, the first call to Write
will trigger an implicit WriteHeader(http.StatusOK).
Thus explicit calls to WriteHeader are mainly used to
send error codes.
package context
import (
	"bufio"
	"fmt"
	"io"
	"net"
	"net/http"
	"sync"
	"github.com/kataras/iris/core/errors"
)
type ResponseWriter interface {
	http.ResponseWriter
	http.Flusher
	http.Hijacker
	http.CloseNotifier
	http.Pusher
	Naive() http.ResponseWriter
	BeginResponse(http.ResponseWriter)
	EndResponse()
	Writef(format string, a ...interface{}) (n int, err error)
	WriteString(s string) (n int, err error)
	StatusCode() int
	Written() int
	SetWritten(int)
	SetBeforeFlush(cb func())
	GetBeforeFlush() func()
	FlushResponse()
	Clone() ResponseWriter
	WriteTo(ResponseWriter)
}
var rpool = sync.Pool{New: func() interface{} { return &responseWriter{} }}
func AcquireResponseWriter() ResponseWriter {
	return rpool.Get().(*responseWriter)
}
func releaseResponseWriter(w ResponseWriter) {
	rpool.Put(w)
}
type responseWriter struct {
	http.ResponseWriter
	statusCode int  
	written int  
	beforeFlush func()
}
var _ ResponseWriter = (*responseWriter)(nil)
const (
	defaultStatusCode = http.StatusOK
	NoWritten = -1
	StatusCodeWritten = 0
)
func (w *responseWriter) Naive() http.ResponseWriter {
	return w.ResponseWriter
}
func (w *responseWriter) BeginResponse(underline http.ResponseWriter) {
	w.beforeFlush = nil
	w.written = NoWritten
	w.statusCode = defaultStatusCode
	w.ResponseWriter = underline
}
func (w *responseWriter) EndResponse() {
	releaseResponseWriter(w)
}
func (w *responseWriter) SetWritten(n int) {
	if n >= NoWritten && n <= StatusCodeWritten {
		w.written = n
	}
}
func (w *responseWriter) Written() int {
	return w.written
}