|
@@ -3,6 +3,7 @@ package io
|
|
|
import (
|
|
import (
|
|
|
"io"
|
|
"io"
|
|
|
|
|
|
|
|
|
|
+ "github.com/v2ray/v2ray-core/common"
|
|
|
"github.com/v2ray/v2ray-core/common/alloc"
|
|
"github.com/v2ray/v2ray-core/common/alloc"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -12,6 +13,11 @@ type Writer interface {
|
|
|
Write(*alloc.Buffer) error
|
|
Write(*alloc.Buffer) error
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+type ReleasableWriter interface {
|
|
|
|
|
+ Writer
|
|
|
|
|
+ common.Releasable
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// AdaptiveWriter is a Writer that writes alloc.Buffer into underlying writer.
|
|
// AdaptiveWriter is a Writer that writes alloc.Buffer into underlying writer.
|
|
|
type AdaptiveWriter struct {
|
|
type AdaptiveWriter struct {
|
|
|
writer io.Writer
|
|
writer io.Writer
|