Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 4,997 for write0 (0.29 sec)

  1. src/text/tabwriter/tabwriter.go

    type osError struct {
    	err error
    }
    
    func (b *Writer) write0(buf []byte) {
    	n, err := b.output.Write(buf)
    	if n != len(buf) && err == nil {
    		err = io.ErrShortWrite
    	}
    	if err != nil {
    		panic(osError{err})
    	}
    }
    
    func (b *Writer) writeN(src []byte, n int) {
    	for n > len(src) {
    		b.write0(src)
    		n -= len(src)
    	}
    	b.write0(src[0:n])
    }
    
    var (
    	newline = []byte{'\n'}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 29 16:46:34 UTC 2024
    - 17.8K bytes
    - Viewed (0)
  2. src/encoding/csv/writer.go

    }
    
    // NewWriter returns a new Writer that writes to w.
    func NewWriter(w io.Writer) *Writer {
    	return &Writer{
    		Comma: ',',
    		w:     bufio.NewWriter(w),
    	}
    }
    
    // Write writes a single CSV record to w along with any necessary quoting.
    // A record is a slice of strings with each string being one field.
    // Writes are buffered, so [Writer.Flush] must eventually be called to ensure
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  3. src/mime/quotedprintable/writer.go

    }
    
    // Write encodes p using quoted-printable encoding and writes it to the
    // underlying [io.Writer]. It limits line length to 76 characters. The encoded
    // bytes are not necessarily flushed until the [Writer] is closed.
    func (w *Writer) Write(p []byte) (n int, err error) {
    	for i, b := range p {
    		switch {
    		// Simple writes are done in batch.
    		case b >= '!' && b <= '~' && b != '=':
    			continue
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 16:12:35 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  4. src/compress/lzw/writer.go

    	invalidEntry = 0
    )
    
    // Writer is an LZW compressor. It writes the compressed form of the data
    // to an underlying writer (see [NewWriter]).
    type Writer struct {
    	// w is the writer that compressed bytes are written to.
    	w writer
    	// litWidth is the width in bits of literal codes.
    	litWidth uint
    	// order, write, bits, nBits and width are the state for
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:40 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  5. src/compress/zlib/writer.go

    )
    
    // A Writer takes data written to it and writes the compressed
    // form of that data to an underlying writer (see NewWriter).
    type Writer struct {
    	w           io.Writer
    	level       int
    	dict        []byte
    	compressor  *flate.Writer
    	digest      hash.Hash32
    	err         error
    	scratch     [4]byte
    	wroteHeader bool
    }
    
    // NewWriter creates a new Writer.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 27 18:51:27 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  6. src/internal/trace/raw/writer.go

    // NewWriter creates a new byte format writer.
    func NewWriter(w io.Writer, v version.Version) (*Writer, error) {
    	_, err := version.WriteHeader(w, v)
    	return &Writer{w: w, v: v, specs: v.Specs()}, err
    }
    
    // WriteEvent writes a single event to the trace wire format stream.
    func (w *Writer) WriteEvent(e Event) error {
    	// Check version.
    	if e.Version != w.v {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  7. src/testing/iotest/writer.go

    import "io"
    
    // TruncateWriter returns a Writer that writes to w
    // but stops silently after n bytes.
    func TruncateWriter(w io.Writer, n int64) io.Writer {
    	return &truncateWriter{w, n}
    }
    
    type truncateWriter struct {
    	w io.Writer
    	n int64
    }
    
    func (t *truncateWriter) Write(p []byte) (n int, err error) {
    	if t.n <= 0 {
    		return len(p), nil
    	}
    	// real write
    	n = len(p)
    	if int64(n) > t.n {
    		n = int(t.n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 674 bytes
    - Viewed (0)
  8. src/mime/multipart/writer.go

    	"errors"
    	"fmt"
    	"io"
    	"net/textproto"
    	"slices"
    	"strings"
    )
    
    // A Writer generates multipart messages.
    type Writer struct {
    	w        io.Writer
    	boundary string
    	lastpart *part
    }
    
    // NewWriter returns a new multipart [Writer] with a random boundary,
    // writing to w.
    func NewWriter(w io.Writer) *Writer {
    	return &Writer{
    		w:        w,
    		boundary: randomBoundary(),
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  9. src/net/textproto/writer.go

    package textproto
    
    import (
    	"bufio"
    	"fmt"
    	"io"
    )
    
    // A Writer implements convenience methods for writing
    // requests or responses to a text protocol network connection.
    type Writer struct {
    	W   *bufio.Writer
    	dot *dotWriter
    }
    
    // NewWriter returns a new [Writer] writing to w.
    func NewWriter(w *bufio.Writer) *Writer {
    	return &Writer{W: w}
    }
    
    var crnl = []byte{'\r', '\n'}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  10. src/archive/tar/writer.go

    	"path"
    	"slices"
    	"strings"
    	"time"
    )
    
    // Writer provides sequential writing of a tar archive.
    // [Writer.WriteHeader] begins a new file with the provided [Header],
    // and then Writer can be treated as an io.Writer to supply that file's data.
    type Writer struct {
    	w    io.Writer
    	pad  int64      // Amount of padding to write after current file entry
    	curr fileWriter // Writer for current file entry
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.6K bytes
    - Viewed (0)
Back to top