Quantcast
Channel: User Norbert - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Answer by Norbert for New line delimited input stream written to file

$
0
0

You can for example use the following pattern to read until your termination byte:

    r := bufio.NewReader(conn)    for {        yourLine, err := r.ReadBytes(10)        ... write your file ...    }

Similar there is also r.ReadString('\n') which would too.


Viewing all articles
Browse latest Browse all 42

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>