Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for readByte (0.16 sec)

  1. src/bytes/buffer_test.go

    	}
    
    	// after successful read
    	if _, err := b.ReadBytes('m'); err != nil {
    		t.Fatalf("ReadBytes: %v", err)
    	}
    	if err := b.UnreadByte(); err != nil {
    		t.Fatalf("UnreadByte: %v", err)
    	}
    	c, err := b.ReadByte()
    	if err != nil {
    		t.Fatalf("ReadByte: %v", err)
    	}
    	if c != 'm' {
    		t.Errorf("ReadByte = %q; want %q", c, 'm')
    	}
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  2. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  3. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 19.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

        assertTrue(in.readBoolean());
      }
    
      public void testNewDataInput_readByte() {
        ByteArrayDataInput in = ByteStreams.newDataInput(bytes);
        for (byte aByte : bytes) {
          assertEquals(aByte, in.readByte());
        }
        IllegalStateException expected = assertThrows(IllegalStateException.class, () -> in.readByte());
        assertThat(expected).hasCauseThat().isInstanceOf(EOFException.class);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  5. cmd/streaming-signature-v4.go

    		cr.err = errMalformedEncoding
    		return n, cr.err
    	}
    	b, err := cr.reader.ReadByte()
    	if err == io.EOF {
    		err = io.ErrUnexpectedEOF
    	}
    	if err != nil {
    		cr.err = err
    		return n, cr.err
    	}
    	if b != '\r' {
    		cr.err = errMalformedEncoding
    		return n, cr.err
    	}
    	b, err = cr.reader.ReadByte()
    	if err == io.EOF {
    		err = io.ErrUnexpectedEOF
    	}
    	if err != nil {
    		cr.err = err
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 18.2K bytes
    - Viewed (0)
  6. 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 May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 22.5K bytes
    - Viewed (1)
  7. okhttp/src/main/kotlin/okhttp3/internal/-UtilCommon.kt

      writeByte(medium.ushr(8) and 0xff)
      writeByte(medium and 0xff)
    }
    
    @Throws(IOException::class)
    internal fun BufferedSource.readMedium(): Int {
      return (
        readByte() and 0xff shl 16
          or (readByte() and 0xff shl 8)
          or (readByte() and 0xff)
      )
    }
    
    /** Run [block] until it either throws an [IOException] or completes. */
    internal inline fun ignoreIoExceptions(block: () -> Unit) {
      try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

      @Test
      fun sourceSeesBom() {
        val body = "efbbbf68656c6c6f".decodeHex().toResponseBody()
        val source = body.source()
        assertThat(source.readByte() and 0xff).isEqualTo(0xef)
        assertThat(source.readByte() and 0xff).isEqualTo(0xbb)
        assertThat(source.readByte() and 0xff).isEqualTo(0xbf)
        assertThat(source.readUtf8()).isEqualTo("hello")
      }
    
      @Test
      fun bytesEmpty() {
        val body = body("")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/ByteStreamsTest.java

        assertTrue(in.readBoolean());
      }
    
      public void testNewDataInput_readByte() {
        ByteArrayDataInput in = ByteStreams.newDataInput(bytes);
        for (byte aByte : bytes) {
          assertEquals(aByte, in.readByte());
        }
        IllegalStateException expected = assertThrows(IllegalStateException.class, () -> in.readByte());
        assertThat(expected).hasCauseThat().isInstanceOf(EOFException.class);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (1)
  10. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketReader.kt

        // Disable the timeout to read the first byte of a new frame.
        val b0: Int
        val timeoutBefore = source.timeout().timeoutNanos()
        source.timeout().clearTimeout()
        try {
          b0 = source.readByte() and 0xff
        } finally {
          source.timeout().timeout(timeoutBefore, TimeUnit.NANOSECONDS)
        }
    
        opcode = b0 and B0_MASK_OPCODE
        isFinalFrame = b0 and B0_FLAG_FIN != 0
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (0)
Back to top