1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-04 08:15:21 -05:00

releasable writer

This commit is contained in:
v2ray
2016-03-24 23:36:18 +08:00
parent 760247a4ab
commit e8023f0d92
4 changed files with 14 additions and 5 deletions

View File

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