Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for encodedLength (0.18 sec)

  1. okhttp/src/test/java/okhttp3/internal/http2/HuffmanTest.kt

    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import java.util.Random
    import okhttp3.internal.http2.Huffman.decode
    import okhttp3.internal.http2.Huffman.encode
    import okhttp3.internal.http2.Huffman.encodedLength
    import okio.Buffer
    import okio.ByteString
    import okio.ByteString.Companion.encodeUtf8
    import okio.ByteString.Companion.toByteString
    import org.junit.jupiter.api.Assertions.assertEquals
    import org.junit.jupiter.api.Test
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Jan 04 05:32:07 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/base/Utf8Test.java

        ILL_FORMED_STRINGS = builder.build();
      }
    
      public void testEncodedLength_validStrings() {
        assertEquals(0, Utf8.encodedLength(""));
        assertEquals(11, Utf8.encodedLength("Hello world"));
        assertEquals(8, Utf8.encodedLength("Résumé"));
        assertEquals(
            461,
            Utf8.encodedLength(
                "威廉·莎士比亞(William Shakespeare,"
                    + "1564年4月26號—1616年4月23號[1])係隻英國嗰演員、劇作家同詩人,"
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/base/Utf8Test.java

        ILL_FORMED_STRINGS = builder.build();
      }
    
      public void testEncodedLength_validStrings() {
        assertEquals(0, Utf8.encodedLength(""));
        assertEquals(11, Utf8.encodedLength("Hello world"));
        assertEquals(8, Utf8.encodedLength("Résumé"));
        assertEquals(
            461,
            Utf8.encodedLength(
                "威廉·莎士比亞(William Shakespeare,"
                    + "1564年4月26號—1616年4月23號[1])係隻英國嗰演員、劇作家同詩人,"
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/base/Utf8.java

       * time and space.
       *
       * @throws IllegalArgumentException if {@code sequence} contains ill-formed UTF-16 (unpaired
       *     surrogates)
       */
      public static int encodedLength(CharSequence sequence) {
        // Warning to maintainers: this implementation is highly optimized.
        int utf16Length = sequence.length();
        int utf8Length = utf16Length;
        int i = 0;
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/Utf8.java

       * time and space.
       *
       * @throws IllegalArgumentException if {@code sequence} contains ill-formed UTF-16 (unpaired
       *     surrogates)
       */
      public static int encodedLength(CharSequence sequence) {
        // Warning to maintainers: this implementation is highly optimized.
        int utf16Length = sequence.length();
        int utf8Length = utf16Length;
        int i = 0;
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/http2/Huffman.kt

          accumulator = accumulator shl (8 - accumulatorBitCount)
          accumulator = accumulator or (0xffL ushr accumulatorBitCount)
          sink.writeByte(accumulator.toInt())
        }
      }
    
      fun encodedLength(bytes: ByteString): Int {
        var bitCount = 0L
    
        for (i in 0 until bytes.size) {
          val byteIn = bytes[i] and 0xff
          bitCount += CODE_BIT_COUNTS[byteIn].toLong()
        }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/http2/Hpack.kt

              value = value ushr 7
            }
            out.writeByte(value)
          }
    
          @Throws(IOException::class)
          fun writeByteString(data: ByteString) {
            if (useCompression && Huffman.encodedLength(data) < data.size) {
              val huffmanBuffer = Buffer()
              Huffman.encode(data, huffmanBuffer)
              val huffmanBytes = huffmanBuffer.readByteString()
    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