io

package module
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 5 Imported by: 0

README

io

This is a non-blocking multiple reader function

Use this like go default MultiReader

In order to fix go MultiReader, if Reader[1] has no data outputting, it will wait forever,instead of executing Reader[2].

If the data of Reader[2] comes at this time, sometimes it will cause some problems.

Please judge which MulitiReader to use according to your own needs.

tips:

If the read content is larger than the cache, the content will be cut off.
buff  := make([]byte,3)

b1:="1234"
b2:="abcdef"
reader := MultiReader(strings.NewReader(b1),strings.NewReader(b2))

if use this multi reader this perhaps:

123 abc 4 def

If you want to solve this problem, give it a bigger cache.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.0.9

func Close(reader io.Reader) error

func MultiReader

func MultiReader(readers ...io.Reader) io.Reader

MultiReader returns a Reader that's the logical concatenation of the provided input readers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readers return a non-nil, non-EOF error, Read will return that error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL