Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for readAndWriteUnsafe (0.25 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt

          random.nextBytes(maskKey!!)
          sinkBuffer.write(maskKey)
    
          if (length > 0) {
            val payloadStart = sinkBuffer.size
            sinkBuffer.write(payload)
    
            sinkBuffer.readAndWriteUnsafe(maskCursor!!)
            maskCursor.seek(payloadStart)
            toggleMask(maskCursor, maskKey)
            maskCursor.close()
          }
        } else {
          sinkBuffer.writeByte(b1)
          sinkBuffer.write(payload)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketReader.kt

      @Throws(IOException::class)
      private fun readControlFrame() {
        if (frameLength > 0L) {
          source.readFully(controlFrameBuffer, frameLength)
    
          if (!isClient) {
            controlFrameBuffer.readAndWriteUnsafe(maskCursor!!)
            maskCursor.seek(0)
            toggleMask(maskCursor, maskKey!!)
            maskCursor.close()
          }
        }
    
        when (opcode) {
          OPCODE_CONTROL_PING -> {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/ws/MessageDeflater.kt

        deflaterSink.flush()
    
        if (deflatedBytes.endsWith(EMPTY_DEFLATE_BLOCK)) {
          val newSize = deflatedBytes.size - LAST_OCTETS_COUNT_TO_REMOVE_AFTER_DEFLATION
          deflatedBytes.readAndWriteUnsafe().use { cursor ->
            cursor.resizeBuffer(newSize)
          }
        } else {
          // Same as adding EMPTY_DEFLATE_BLOCK and then removing 4 bytes.
          deflatedBytes.writeByte(0x00)
        }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
Back to top