func (w *responseWriter) Written() int {
	return w.written
}
Written should returns the total length of bytes that were being written to the client.
In addition iris provides some variables to help low-level actions:
NoWritten, means that nothing were written yet and the response writer is still live.
StatusCodeWritten, means that status code were written but no other bytes are written to the client, response writer may closed.
> 0 means that the reply was written and it's the total number of bytes were written.
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
	}
}