mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
276 B
16 lines
276 B
8 years ago
|
package buf
|
||
|
|
||
|
import "io"
|
||
|
|
||
|
func ReadFrom(reader io.Reader) Supplier {
|
||
|
return func(b []byte) (int, error) {
|
||
|
return reader.Read(b)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func ReadFullFrom(reader io.Reader, size int) Supplier {
|
||
|
return func(b []byte) (int, error) {
|
||
|
return io.ReadFull(reader, b[:size])
|
||
|
}
|
||
|
}
|