讨论数量:
这样行吗?
strReader := strings.NewReader( "In Go, input and output operations are achieved using primitives that model data as streams of bytes that can be read from or written to. To do this, the Go io package provides interfaces io.Reader and io.Writer, for data input and output operations respectively, as shown in the figure below")
reader := bufio.NewReader(strReader)
part = make([]byte, chunksize)
for {
if count, err = reader.Read(part); err != nil {
break
}
_, err = conn.Write(part[:count])
if err != nil {
return
}
}
这样行吗?