func (s str) writeTo(w io.Writer) error {
    if err := writeUint16(w, uint16(len(s))); err != nil {
        return err
    }
    if _, err := io.WriteString(w, string(s)); err != nil {
        return err
    }
    return nil
}
// Write the encoded str to io.Writer

Write the encoded str to io.Writer
// Write the encoded str to io . Writer
func (s str) writeTo(w io.Writer) error {
    if err := writeUint16(w, uint16(len(s))); err != nil {
        return err
    }
    if _, err := io.WriteString(w, string(s)); err != nil {
        return err
    }
    return nil
}
func ( s str ) writeTo ( w io . Writer ) error { if err := writeUint16 ( w , uint16 ( len ( s ) ) ) ; err != nil { return err } if _ , err := io . WriteString ( w , string ( s ) ) ; err != nil { return err } return nil }
Write the encoded str to io.Writer
Write the encoded str to io . Writer