Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 71 for readByte (0.08 sec)

  1. internal/ringbuffer/ring_buffer.go

    		c2 := n - c1
    		copy(p[c1:], r.buf[0:c2])
    	}
    	r.r = (r.r + n) % r.size
    
    	r.isFull = false
    
    	return n, r.readErr(true)
    }
    
    // ReadByte reads and returns the next byte from the input or ErrIsEmpty.
    func (r *RingBuffer) ReadByte() (b byte, err error) {
    	r.mu.Lock()
    	defer r.mu.Unlock()
    	if err = r.readErr(true); err != nil {
    		return 0, err
    	}
    	for r.w == r.r && !r.isFull {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/io/LittleEndianDataInputStream.java

      @Override
      public char readChar() throws IOException {
        return (char) readUnsignedShort();
      }
    
      @CanIgnoreReturnValue // to skip a byte
      @Override
      public byte readByte() throws IOException {
        return (byte) readUnsignedByte();
      }
    
      @CanIgnoreReturnValue // to skip a byte
      @Override
      public boolean readBoolean() throws IOException {
        return readUnsignedByte() != 0;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed May 17 14:35:11 UTC 2023
    - 7.3K bytes
    - Viewed (0)
  3. cmd/metacache-stream.go

    	mr := msgpNewReader(dec)
    	return &metacacheReader{
    		mr: mr,
    		closer: func() {
    			dec.Reset(nil)
    			s2DecPool.Put(dec)
    			readMsgpReaderPoolPut(mr)
    		},
    		creator: func() error {
    			v, err := mr.ReadByte()
    			if err != nil {
    				return err
    			}
    			switch v {
    			case 1, 2:
    			default:
    				return fmt.Errorf("metacacheReader: Unknown version: %d", v)
    			}
    			return nil
    		},
    	}
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 19.5K bytes
    - Viewed (0)
  4. src/bufio/bufio.go

    	totalLen += len(frag)
    	return fullBuffers, frag, totalLen, err
    }
    
    // ReadBytes reads until the first occurrence of delim in the input,
    // returning a slice containing the data up to and including the delimiter.
    // If ReadBytes encounters an error before finding a delimiter,
    // it returns the data read before the error and the error itself (often io.EOF).
    // ReadBytes returns err != nil if and only if the returned data does not end in
    // delim.
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Thu Oct 12 14:39:08 UTC 2023
    - 21.8K bytes
    - Viewed (0)
  5. guava/src/com/google/common/io/ByteStreams.java

          try {
            return input.readBoolean();
          } catch (IOException e) {
            throw new IllegalStateException(e);
          }
        }
    
        @Override
        public byte readByte() {
          try {
            return input.readByte();
          } catch (EOFException e) {
            throw new IllegalStateException(e);
          } catch (IOException impossible) {
            throw new AssertionError(impossible);
          }
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 29.7K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/hash/BloomFilter.java

          // add non-stateless strategies (for which we've reserved negative ordinals; see
          // Strategy.ordinal()).
          strategyOrdinal = din.readByte();
          numHashFunctions = UnsignedBytes.toInt(din.readByte());
          dataLength = din.readInt();
    
          Strategy strategy = BloomFilterStrategies.values()[strategyOrdinal];
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 23 16:45:30 UTC 2024
    - 26.6K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/cache/DiskLruCacheTest.kt

        v1Creator.setString(1, "BBbb")
        v1Creator.commit()
    
        cache["k1"]!!.use { snapshot1 ->
          val inV1 = snapshot1.getSource(0).buffer()
          assertThat(inV1.readByte()).isEqualTo('A'.code.toByte())
          assertThat(inV1.readByte()).isEqualTo('A'.code.toByte())
    
          val v1Updater = cache.edit("k1")!!
          v1Updater.setString(0, "CCcc")
          v1Updater.setString(1, "DDdd")
          v1Updater.commit()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 14:55:09 UTC 2024
    - 75.8K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbRandomAccessFile.java

            if ( ( read(this.tmp, 0, 1) ) < 0 ) {
                throw new SmbEndOfFileException();
            }
            return this.tmp[ 0 ] != (byte) 0x00;
        }
    
    
        @Override
        public final byte readByte () throws SmbException {
            if ( ( read(this.tmp, 0, 1) ) < 0 ) {
                throw new SmbEndOfFileException();
            }
            return this.tmp[ 0 ];
        }
    
    
        @Override
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Wed Jan 08 12:01:33 UTC 2020
    - 18.5K bytes
    - Viewed (0)
  9. src/bytes/example_test.go

    	fmt.Println(string(rdbuf))
    	// Output:
    	// 1
    	// bcde
    	// a
    }
    
    func ExampleBuffer_ReadByte() {
    	var b bytes.Buffer
    	b.Grow(64)
    	b.Write([]byte("abcde"))
    	c, err := b.ReadByte()
    	if err != nil {
    		panic(err)
    	}
    	fmt.Println(c)
    	fmt.Println(b.String())
    	// Output:
    	// 97
    	// bcde
    }
    
    func ExampleClone() {
    	b := []byte("abc")
    	clone := bytes.Clone(b)
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Aug 07 17:22:36 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        source.timeout().timeout(1000, TimeUnit.MILLISECONDS)
        assertThat(source.readByte()).isEqualTo('A'.code.toByte())
        assertThat(source.readByte()).isEqualTo('B'.code.toByte())
        assertThat(source.readByte()).isEqualTo('C'.code.toByte())
        assertFailsWith<SocketTimeoutException> {
          source.readByte() // If Content-Length was accurate, this would return -1 immediately.
        }
        source.close()
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 131.7K bytes
    - Viewed (0)
Back to top