func (s *Stream) Write(b []byte) (int, error) {
	select {
	case <-s.closeCh:
		return 0, s.closeErr
	default:
		s.wrMu.Lock()
		defer s.wrMu.Unlock()
		return s.writeLocked(b)
	}
}
Write writes data to the connection stream.
The function is blocked until all data are put into stream buffer or timeout.
package quic
import (
	"io"
	"net"
	"os"
	"sync"
	"time"
)
type Stream struct {
	id   uint64
	conn *Conn
	wrMu sync.Mutex
	wrCh chan io.Writer
	wrDl deadlineTimer
	rdMu sync.Mutex
	rdCh chan io.Reader
	rdDl deadlineTimer
	clMu sync.Mutex
	clCh chan error
	closeOnce sync.Once
	closeCh   chan struct{}
	closeErr error
	closeRd  io.Reader
}
var (
	_ net.Conn = (*Stream)(nil)
)
func newStream(conn *Conn, id uint64) *Stream {
	s := &Stream{
		conn:    conn,
		id:      id,
		wrCh:    make(chan io.Writer),
		rdCh:    make(chan io.Reader),
		clCh:    make(chan error),
		closeCh: make(chan struct{}),
	}
	s.wrDl.init()
	s.rdDl.init()
	return s
}