Documentation ¶
Overview ¶
Package stringio provides convenience functions for using strings with common io interfaces such as io.Reader and io.Writer, which normally use byte slices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read reads n bytes from the given io.Reader, and returns those bytes as a string. If the io.Reader provides fewer than n bytes, whatever bytes were returned (even if 0 bytes were returned) will be used to create the result string. The returned int and error values are taken directly from the return values of r.Read().
func ReadAt ¶
ReadAt reads n bytes from the given io.ReaderAt, and returns those bytes as a string. If the io.ReaderAt provides fewer than n bytes, whatever bytes were provided (even if 0 bytes were provided) will be used to create the result string. The returned int and error values are taken directly from the return values of r.ReadAt()
func Write ¶
Write converts str to a byte slice and passes it to w.Write(). The return values are passed unmodified from the call to w.Write().
Write is identical in behavior to io.WriteString, although it will usually be somewhat more performant since it avoids reallocating len(str) bytes if possible.
Types ¶
This section is empty.