Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 27 for ByteReader (0.14 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go

    	"MarshalXML":    {[]string{"*xml.Encoder", "xml.StartElement"}, []string{"error"}}, // xml.Marshaler
    	"ReadByte":      {[]string{}, []string{"byte", "error"}},                           // io.ByteReader
    	"ReadFrom":      {[]string{"=io.Reader"}, []string{"int64", "error"}},              // io.ReaderFrom
    	"ReadRune":      {[]string{}, []string{"rune", "int", "error"}},                    // io.RuneReader
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  6. src/compress/flate/inflate.go

    // the [NewReader] will introduce its own buffering.
    type Reader interface {
    	io.Reader
    	io.ByteReader
    }
    
    // Decompress state.
    type decompressor struct {
    	// Input source.
    	r       Reader
    	rBuf    *bufio.Reader // created if provided io.Reader does not implement io.ByteReader
    	roffset int64
    
    	// Input bits, in top of b.
    	b  uint32
    	nb uint
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 23:20:03 UTC 2023
    - 20.4K bytes
    - Viewed (0)
  7. 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)
  8. src/internal/types/testdata/check/typeparams.go

    // 	if br, ok := r.(io.ByteReader); ok {
    // 		return br.ReadByte()
    // 	}
    // 	var b [1]byte
    // 	_, err := r.Read(b[:])
    // 	return b[0], err
    // }
    //
    // // ReadBytes2 is like ReadByte1 but uses a type switch instead.
    // func ReadByte2[T io.Reader](r T) (byte, error) {
    //         switch br := r.(type) {
    //         case io.ByteReader:
    //                 return br.ReadByte()
    //         }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 19 01:56:58 UTC 2023
    - 15.2K bytes
    - Viewed (0)
  9. src/math/big/floatconv.go

    // [fmt.Scan] for floating point values, which are:
    // 'b' (binary), 'e', 'E', 'f', 'F', 'g' and 'G'.
    // Scan doesn't handle ±Inf.
    func (z *Float) Scan(s fmt.ScanState, ch rune) error {
    	s.SkipSpace()
    	_, _, err := z.scan(byteReader{s}, 0)
    	return err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  10. 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)
Back to top