Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for MessageDeflater (0.17 sec)

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

    import okio.ByteString.Companion.decodeHex
    import okio.DeflaterSink
    
    private val EMPTY_DEFLATE_BLOCK = "000000ffff".decodeHex()
    private const val LAST_OCTETS_COUNT_TO_REMOVE_AFTER_DEFLATION = 4
    
    class MessageDeflater(
      private val noContextTakeover: Boolean,
    ) : Closeable {
      private val deflatedBytes = Buffer()
    
      private val deflater =
        Deflater(
          Deflater.DEFAULT_COMPRESSION,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt

        messageBuffer.write(data)
    
        var b0 = formatOpcode or B0_FLAG_FIN
        if (perMessageDeflate && data.size >= minimumDeflateSize) {
          val messageDeflater =
            this.messageDeflater
              ?: MessageDeflater(noContextTakeover).also { this.messageDeflater = it }
          messageDeflater.deflate(messageBuffer)
          b0 = b0 or B0_FLAG_RSV1
        }
        val dataSize = messageBuffer.size
        sinkBuffer.writeByte(b0)
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/ws/MessageDeflaterInflaterTest.kt

      }
    
      @Test fun `deflate golden value`() {
        val deflater = MessageDeflater(false)
        val deflated = deflater.deflate("Hello deflate!".encodeUtf8())
        assertThat(deflated.hex()).isEqualTo("f248cdc9c95748494dcb492c49550400")
      }
    
      @Test fun `inflate deflate`() {
        val deflater = MessageDeflater(false)
        val inflater = MessageInflater(false)
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 06 05:31:00 UTC 2024
    - 5K bytes
    - Viewed (0)
Back to top