Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for ReadByte (0.21 sec)

  1. okhttp/src/test/java/okhttp3/SocksProxy.kt

        // Read the command.
        val version = fromSource.readByte() and 0xff
        if (version != VERSION_5) throw ProtocolException("unexpected version: $version")
    
        val command = fromSource.readByte() and 0xff
    
        val reserved = fromSource.readByte() and 0xff
        if (reserved != 0) throw ProtocolException("unexpected reserved: $reserved")
    
        val addressType = fromSource.readByte() and 0xff
        val toAddress =
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  2. src/bytes/buffer_test.go

    		buf.WriteByte(testString[1])
    		c, err := buf.ReadByte()
    		if want := testString[1]; err != nil || c != want {
    			t.Errorf("ReadByte: got (%q, %v), want (%q, %v)", c, err, want, nil)
    		}
    		c, err = buf.ReadByte()
    		if err != io.EOF {
    			t.Errorf("ReadByte: got (%q, %v), want (%q, %v)", c, err, byte(0), io.EOF)
    		}
    	}
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 20 01:07:29 GMT 2023
    - 18.1K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/http/HttpHeaders.kt

      var commaFound = false
      loop@ while (!exhausted()) {
        when (this[0]) {
          ','.code.toByte() -> {
            // Consume ','.
            readByte()
            commaFound = true
          }
    
          ' '.code.toByte(), '\t'.code.toByte() -> {
            readByte()
            // Consume space or tab.
          }
    
          else -> break@loop
        }
      }
      return commaFound
    }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  4. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerWriter.kt

      fun writeObjectIdentifier(s: String) {
        val utf8 = Buffer().writeUtf8(s)
        val v1 = utf8.readDecimalLong()
        require(utf8.readByte() == '.'.code.toByte())
        val v2 = utf8.readDecimalLong()
        writeVariableLengthLong(v1 * 40 + v2)
    
        while (!utf8.exhausted()) {
          require(utf8.readByte() == '.'.code.toByte())
          val vN = utf8.readDecimalLong()
          writeVariableLengthLong(vN)
        }
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  5. src/bufio/bufio_test.go

    	}
    	// Test error after ReadByte.
    	_, _, err = r.ReadRune() // reset state
    	if err != nil {
    		t.Error("unexpected error on ReadRune (2):", err)
    	}
    	for range buf {
    		_, err = r.ReadByte()
    		if err != nil {
    			t.Error("unexpected error on ReadByte (2):", err)
    		}
    	}
    	if r.UnreadRune() == nil {
    		t.Error("expected error after ReadByte")
    	}
    	// Test error after UnreadByte.
    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)
  6. cmd/streaming-v4-unsigned.go

    			return n, nil
    		}
    		cr.offset = 0
    		buf = buf[n:]
    	}
    	// mustRead reads from input and compares against provided slice.
    	mustRead := func(b ...byte) error {
    		for _, want := range b {
    			got, err := cr.reader.ReadByte()
    			if err == io.EOF {
    				return io.ErrUnexpectedEOF
    			}
    			if got != want {
    				if cr.debug {
    					fmt.Printf("mustread: want: %q got: %q\n", string(want), string(got))
    				}
    				return errMalformedEncoding
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat May 06 02:53:12 GMT 2023
    - 6.1K bytes
    - Viewed (1)
  7. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Reader.kt

        val length = source.readMedium()
        if (length > INITIAL_MAX_FRAME_SIZE) {
          throw IOException("FRAME_SIZE_ERROR: $length")
        }
        val type = source.readByte() and 0xff
        val flags = source.readByte() and 0xff
        val streamId = source.readInt() and 0x7fffffff // Ignore reserved bit.
        if (type != TYPE_WINDOW_UPDATE && logger.isLoggable(FINE)) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 19.9K bytes
    - Viewed (0)
  8. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt

              }
    
              var lengthBits = source.readByte().toLong() and 0xff
              if (lengthBits == 0L || lengthBytes == 1 && lengthBits and 0b1000_0000 == 0L) {
                throw ProtocolException("invalid encoding for length")
              }
    
              for (i in 1 until lengthBytes) {
                lengthBits = lengthBits shl 8
                lengthBits += source.readByte().toInt() and 0xff
              }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java

        in.readFully(b);
        assertEquals(-100, b[0]);
        assertEquals(100, b[1]);
        assertEquals(true, in.readBoolean());
        assertEquals(false, in.readBoolean());
        assertEquals(100, in.readByte());
        assertEquals(-100, in.readByte());
        assertEquals(200, in.readUnsignedByte());
        assertEquals('\u6100', in.readChar());
        assertEquals(-12150, in.readShort());
        assertEquals(20675, in.readUnsignedShort());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.7K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/http2/Hpack.kt

              dynamicTable[index] = entry
            }
            dynamicTableByteCount += delta
          }
    
          @Throws(IOException::class)
          private fun readByte(): Int {
            return source.readByte() and 0xff
          }
    
          @Throws(IOException::class)
          fun readInt(
            firstByte: Int,
            prefixMask: Int,
          ): Int {
            val prefix = firstByte and prefixMask
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 22.5K bytes
    - Viewed (1)
Back to top