mirror of
https://github.com/golang/go
synced 2024-09-30 15:18:32 -06:00
compress/flate: clarify the behavior of Writer.Flush
Fixes #16068 Change-Id: I04e80a181c0b7356996f7a1158ea4895ff9e1e39 Reviewed-on: https://go-review.googlesource.com/28477 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
f1ebe8a03c
commit
960016eca2
@ -702,10 +702,12 @@ func (w *Writer) Write(data []byte) (n int, err error) {
|
|||||||
return w.d.write(data)
|
return w.d.write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush flushes any pending compressed data to the underlying writer.
|
// Flush flushes any pending data to the underlying writer.
|
||||||
// It is useful mainly in compressed network protocols, to ensure that
|
// It is useful mainly in compressed network protocols, to ensure that
|
||||||
// a remote reader has enough data to reconstruct a packet.
|
// a remote reader has enough data to reconstruct a packet.
|
||||||
// Flush does not return until the data has been written.
|
// Flush does not return until the data has been written.
|
||||||
|
// Calling Flush when there is no pending data still causes the Writer
|
||||||
|
// to emit a sync marker of at least 4 bytes.
|
||||||
// If the underlying writer returns an error, Flush returns that error.
|
// If the underlying writer returns an error, Flush returns that error.
|
||||||
//
|
//
|
||||||
// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH.
|
// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH.
|
||||||
|
Loading…
Reference in New Issue
Block a user