Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for ByteReader (0.91 sec)

  1. src/internal/trace/batch.go

    	return b.exp == event.NoExperiment && len(b.data) > 0 && event.Type(b.data[0]) == go122.EvFrequency
    }
    
    // readBatch reads the next full batch from r.
    func readBatch(r interface {
    	io.Reader
    	io.ByteReader
    }) (batch, uint64, error) {
    	// Read batch header byte.
    	b, err := r.ReadByte()
    	if err != nil {
    		return batch{}, 0, err
    	}
    	if typ := event.Type(b); typ != go122.EvEventBatch && typ != go122.EvExperimentalBatch {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  2. src/image/gif/reader.go

    	errBadPixel  = errors.New("gif: invalid pixel value")
    )
    
    // If the io.Reader does not also have ReadByte, then decode will introduce its own buffering.
    type reader interface {
    	io.Reader
    	io.ByteReader
    }
    
    // Masks etc.
    const (
    	// Fields.
    	fColorTable         = 1 << 7
    	fInterlace          = 1 << 6
    	fColorTableBitsMask = 7
    
    	// Graphic control flags.
    	gcTransparentColorSet = 1 << 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:15:54 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  3. src/net/http/transfer.go

    var ErrLineTooLong = internal.ErrLineTooLong
    
    type errorReader struct {
    	err error
    }
    
    func (r errorReader) Read(p []byte) (n int, err error) {
    	return 0, r.err
    }
    
    type byteReader struct {
    	b    byte
    	done bool
    }
    
    func (br *byteReader) Read(p []byte) (n int, err error) {
    	if br.done {
    		return 0, io.EOF
    	}
    	if len(p) == 0 {
    		return 0, nil
    	}
    	br.done = true
    	p[0] = br.b
    	return 1, io.EOF
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 22:14:00 UTC 2024
    - 31.1K bytes
    - Viewed (0)
  4. src/io/io.go

    //
    // ReadByte provides an efficient interface for byte-at-time
    // processing. A [Reader] that does not implement  ByteReader
    // can be wrapped using bufio.NewReader to add this method.
    type ByteReader interface {
    	ReadByte() (byte, error)
    }
    
    // ByteScanner is the interface that adds the UnreadByte method to the
    // basic ReadByte method.
    //
    // UnreadByte causes the next call to ReadByte to return the last byte read.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:34:10 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  5. src/image/gif/reader_test.go

    	paletteStr = "\x10\x20\x30\x40\x50\x60" // the color table, also known as a palette
    	trailerStr = "\x3b"
    )
    
    // lzw.NewReader wants an io.ByteReader, this ensures we're compatible.
    var _ io.ByteReader = (*blockReader)(nil)
    
    // lzwEncode returns an LZW encoding (with 2-bit literals) of in.
    func lzwEncode(in []byte) []byte {
    	b := &bytes.Buffer{}
    	w := lzw.NewWriter(b, lzw.LSB, 2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:15:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  6. src/compress/bzip2/huffman.go

    			// Get next bit - fast path.
    			br.bits--
    			bit = uint16(br.n>>(br.bits&63)) & 1
    		} else {
    			// Get next bit - slow path.
    			// Use ReadBits to retrieve a single bit
    			// from the underling io.ByteReader.
    			bit = uint16(br.ReadBits(1))
    		}
    
    		// Trick a compiler into generating conditional move instead of branch,
    		// by making both loads unconditional.
    		l, r := node.left, node.right
    
    		if bit == 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:44:37 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  7. src/internal/zstd/zstd.go

    func (r *Reader) Read(p []byte) (int, error) {
    	if err := r.refillIfNeeded(); err != nil {
    		return 0, err
    	}
    	n := copy(p, r.buffer[r.off:])
    	r.off += n
    	return n, nil
    }
    
    // ReadByte implements [io.ByteReader].
    func (r *Reader) ReadByte() (byte, error) {
    	if err := r.refillIfNeeded(); err != nil {
    		return 0, err
    	}
    	ret := r.buffer[r.off]
    	r.off++
    	return ret, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 30 04:10:45 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  8. src/compress/bzip2/bzip2.go

    	repeats     uint     // the number of copies of lastByte to output.
    }
    
    // NewReader returns an io.Reader which decompresses bzip2 data from r.
    // If r does not also implement [io.ByteReader],
    // the decompressor may read more data than necessary from r.
    func NewReader(r io.Reader) io.Reader {
    	bz2 := new(reader)
    	bz2.br = newBitReader(r)
    	return bz2
    }
    
    const bzip2FileMagic = 0x425a // "BZ"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:40 UTC 2024
    - 13K bytes
    - Viewed (0)
  9. src/encoding/xml/xml.go

    	// as if the entire XML stream were wrapped in an element containing
    	// the attribute xmlns="DefaultSpace".
    	DefaultSpace string
    
    	r              io.ByteReader
    	t              TokenReader
    	buf            bytes.Buffer
    	saved          *bytes.Buffer
    	stk            *stack
    	free           *stack
    	needClose      bool
    	toClose        Name
    	nextToken      Token
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 47.3K bytes
    - Viewed (0)
  10. src/encoding/xml/xml_test.go

    	d := NewDecoder(strings.NewReader(nonStrictInput))
    	d.Strict = false
    	testRawToken(t, d, nonStrictInput, nonStrictTokens)
    }
    
    type downCaser struct {
    	t *testing.T
    	r io.ByteReader
    }
    
    func (d *downCaser) ReadByte() (c byte, err error) {
    	c, err = d.r.ReadByte()
    	if c >= 'A' && c <= 'Z' {
    		c += 'a' - 'A'
    	}
    	return
    }
    
    func (d *downCaser) Read(p []byte) (int, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 36.9K bytes
    - Viewed (0)
Back to top