Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ReadSlice (0.23 sec)

  1. src/bufio/bufio.go

    func (b *Reader) Buffered() int { return b.w - b.r }
    
    // ReadSlice reads until the first occurrence of delim in the input,
    // returning a slice pointing at the bytes in the buffer.
    // The bytes stop being valid at the next read.
    // If ReadSlice encounters an error before finding a delimiter,
    // it returns all the data in the buffer and the error itself (often io.EOF).
    // ReadSlice fails with error [ErrBufferFull] if the buffer fills without a delim.
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  2. src/bufio/bufio_test.go

    	}
    	// Test error after ReadSlice.
    	_, _, err = r.ReadRune() // reset state
    	if err != nil {
    		t.Error("unexpected error on ReadRune (4):", err)
    	}
    	_, err = r.ReadSlice(0)
    	if err != io.EOF {
    		t.Error("unexpected error on ReadSlice (4):", err)
    	}
    	if r.UnreadRune() == nil {
    		t.Error("expected error after ReadSlice (4)")
    	}
    }
    
    func TestUnreadRuneAtEOF(t *testing.T) {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  3. src/bytes/buffer.go

    func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) {
    	slice, err := b.readSlice(delim)
    	// return a copy of slice. The buffer's backing array may
    	// be overwritten by later calls.
    	line = append(line, slice...)
    	return line, err
    }
    
    // readSlice is like ReadBytes but returns a reference to internal buffer data.
    func (b *Buffer) readSlice(delim byte) (line []byte, err error) {
    	i := IndexByte(b.buf[b.off:], delim)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  4. cmd/streaming-signature-v4.go

    // The returned bytes are owned by the bufio.Reader
    // so they are only valid until the next bufio read.
    func readChunkLine(b *bufio.Reader) ([]byte, []byte, error) {
    	buf, err := b.ReadSlice('\n')
    	if err != nil {
    		// We always know when EOF is coming.
    		// If the caller asked for a line, there should be a line.
    		if err == io.EOF {
    			err = io.ErrUnexpectedEOF
    		} else if err == bufio.ErrBufferFull {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 18.2K bytes
    - Viewed (0)
  5. api/go1.txt

    pkg bufio, method (*Reader) ReadBytes(uint8) ([]uint8, error)
    pkg bufio, method (*Reader) ReadLine() ([]uint8, bool, error)
    pkg bufio, method (*Reader) ReadRune() (int32, int, error)
    pkg bufio, method (*Reader) ReadSlice(uint8) ([]uint8, error)
    pkg bufio, method (*Reader) ReadString(uint8) (string, error)
    pkg bufio, method (*Reader) UnreadByte() error
    pkg bufio, method (*Reader) UnreadRune() error
    pkg bufio, method (*Writer) Available() int
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
Back to top