mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-03 15:09:51 +00:00
16 lines
276 B
Go
16 lines
276 B
Go
![]() |
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])
|
||
|
}
|
||
|
}
|