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.
20 lines
314 B
20 lines
314 B
package structure
|
|
|
|
import (
|
|
"github.com/alibaba/RedisShake/internal/log"
|
|
"io"
|
|
)
|
|
|
|
func ReadByte(rd io.Reader) byte {
|
|
b := ReadBytes(rd, 1)[0]
|
|
return b
|
|
}
|
|
|
|
func ReadBytes(rd io.Reader, n int) []byte {
|
|
buf := make([]byte, n)
|
|
_, err := io.ReadFull(rd, buf)
|
|
if err != nil {
|
|
log.PanicError(err)
|
|
}
|
|
return buf
|
|
}
|
|
|