// Commit commits the current bytes to the writer, even if a byte is only
// partially written. Partial bytes will be zero-filled. A commit will happen
// any time that a write would overflow the current chunk.
//
// The number of bits written are returned, and any error that occurred when
// writing.
//
// Deprecated: Use CommitPending instead. If it is necessary to write a chunk
// of unset bits, it is preferred to use WriteBit or WriteBits to write the
// unset bits instead of using Commit to force an empty chunk to be written.
Commit commits the current bytes to the writer, even if a byte is only
partially written. Partial bytes will be zero-filled. A commit will happen
any time that a write would overflow the current chunk.

The number of bits written are returned, and any error that occurred when
writing.

Use CommitPending instead. If it is necessary to write a chunk
of unset bits, it is preferred to use WriteBit or WriteBits to write the
unset bits instead of using Commit to force an empty chunk to be written.
// Commit commits the current bytes to the writer even if a byte is only // partially written . Partial bytes will be zero - filled . A commit will happen // any time that a write would overflow the current chunk . // // The number of bits written are returned and any error that occurred when // writing . // // Deprecated : Use CommitPending instead . If it is necessary to write a chunk // of unset bits it is preferred to use WriteBit or WriteBits to write the // unset bits instead of using Commit to force an empty chunk to be written .
func (w *Writer) Commit() (written int, err error) {
	written, err = w.w.Write(w.bytes)
	written *= byteSize
	w.bytes = make([]byte, len(w.bytes))
	w.index = 0
	return
}
func ( w * Writer ) Commit ( ) ( written int , err error ) { written , err = w . w . Write ( w . bytes ) written *= byteSize w . bytes = make ( [ ] byte , len ( w . bytes ) ) w . index = 0 return }
Commit commits the current bytes to the writer, even if a byte is only
partially written.
Commit commits the current bytes to the writer even if a byte is only partially written .