mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 20:37:40 +03:00
Refine buffered reader
This commit is contained in:
parent
857116b2cc
commit
82cc7d29b8
2 changed files with 34 additions and 1 deletions
|
@ -29,6 +29,10 @@ func (r *BufferedReader) Read(p []byte) (n int, err error) {
|
|||
return r.buffer.Read(p)
|
||||
}
|
||||
|
||||
func (r *BufferedReader) WriteTo(w io.Writer) (n int64, err error) {
|
||||
return CopyExtendedBuffer(NewExtendedWriter(w), NewExtendedReader(r.upstream), r.buffer)
|
||||
}
|
||||
|
||||
func (w *BufferedReader) Upstream() any {
|
||||
return w.upstream
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue