mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
merge noOpBytesWriter into noOpWriter
This commit is contained in:
parent
25dd739285
commit
052d2d8278
@ -183,13 +183,11 @@ func (noOpWriter) WriteMultiBuffer(b MultiBuffer) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type noOpBytesWriter struct{}
|
func (noOpWriter) Write(b []byte) (int, error) {
|
||||||
|
|
||||||
func (noOpBytesWriter) Write(b []byte) (int, error) {
|
|
||||||
return len(b), nil
|
return len(b), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (noOpBytesWriter) ReadFrom(reader io.Reader) (int64, error) {
|
func (noOpWriter) ReadFrom(reader io.Reader) (int64, error) {
|
||||||
b := New()
|
b := New()
|
||||||
defer b.Release()
|
defer b.Release()
|
||||||
|
|
||||||
@ -211,5 +209,5 @@ var (
|
|||||||
Discard Writer = noOpWriter{}
|
Discard Writer = noOpWriter{}
|
||||||
|
|
||||||
// DiscardBytes is an io.Writer that swallows all contents written in.
|
// DiscardBytes is an io.Writer that swallows all contents written in.
|
||||||
DiscardBytes io.Writer = noOpBytesWriter{}
|
DiscardBytes io.Writer = noOpWriter{}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user