Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 70 for writeUtf8 (0.17 sec)

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

            val utf8 = IDENTITY.encode(codePoint).encodeUtf8()
            val percentEncoded = Buffer()
            for (i in 0 until utf8.size) {
              percentEncoded.writeUtf8("%")
                .writeUtf8(ByteString.of(utf8[i]).hex().uppercase())
            }
            return percentEncoded.readUtf8()
          }
        },
    
        /** URLs that contain this character in this component are invalid.  */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

      if (result.containsInvalidLabelLengths()) return null
    
      return result
    }
    
    internal fun idnToAscii(host: String): String? {
      val bufferA = Buffer().writeUtf8(host)
      val bufferB = Buffer()
    
      // 1. Map, from bufferA to bufferB.
      while (!bufferA.exhausted()) {
        val codePoint = bufferA.readUtf8CodePoint()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  3. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

        server.enqueue(MockResponse())
        val body: RequestBody =
          object : RequestBody() {
            override fun contentType() = PLAIN
    
            override fun writeTo(sink: BufferedSink) {
              sink.writeUtf8("Hi!")
            }
          }
        val response = client.newCall(request().post(body).build()).execute()
        response.body.close()
        applicationLogs
          .assertLogEqual("--> POST $url")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 37.6K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/InterceptorTest.kt

          override fun write(
            source: Buffer,
            byteCount: Long,
          ) {
            original.writeUtf8(source.readUtf8(byteCount).uppercase())
          }
        }
      }
    
      private fun gzip(data: String): Buffer {
        val result = Buffer()
        val sink = GzipSink(result).buffer()
        sink.writeUtf8(data)
        sink.close()
        return result
      }
    
      private fun addInterceptor(
        network: Boolean,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 27.8K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/WebPlatformUrlTestData.kt

              i++
            }
    
            list += element
          }
          return list
        }
    
        private fun unescape(s: String): String {
          return buildString {
            val buffer = Buffer().writeUtf8(s)
            while (!buffer.exhausted()) {
              val c = buffer.readUtf8CodePoint()
              if (c != '\\'.code) {
                append(c.toChar())
                continue
              }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/http/HttpHeaders.kt

    fun Headers.parseChallenges(headerName: String): List<Challenge> {
      val result = mutableListOf<Challenge>()
      for (h in 0 until size) {
        if (headerName.equals(name(h), ignoreCase = true)) {
          val header = Buffer().writeUtf8(value(h))
          try {
            header.readChallengeHeader(result)
          } catch (e: EOFException) {
            Platform.get().log("Unable to parse challenge", Platform.WARN, e)
          }
        }
      }
      return result
    }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

          }
    
        if (metadataFile != null) {
          val contents =
            fileSystem.read(metadataFile) {
              readUtf8()
            }
    
          fileSystem.write(metadataFile) {
            writeUtf8(corruptor(contents))
          }
        }
      }
    
      private fun testCorruptingCache(corruptor: () -> Unit): Response {
        server.useHttps(handshakeCertificates.sslSocketFactory())
        server.enqueue(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (1)
  8. okhttp/src/test/java/okhttp3/internal/cache/DiskLruCacheTest.kt

        vararg bodyLines: String,
      ) {
        filesystem.write(journalFile) {
          writeUtf8(
            """
            |$magic
            |$version
            |$appVersion
            |$valueCount
            |$blank
            |
            """.trimMargin(),
          )
          for (line in bodyLines) {
            writeUtf8(line)
            writeUtf8("\n")
          }
        }
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 75.8K bytes
    - Viewed (0)
  9. okhttp-sse/src/test/java/okhttp3/sse/internal/ServerSentEventIteratorTest.kt

            ) {
              callbacks.add(Event(id, type, data))
            }
    
            override fun onRetryChange(timeMs: Long) {
              callbacks.add(timeMs)
            }
          }
        val buffer = Buffer().writeUtf8(source)
        val reader = ServerSentEventReader(buffer, callback)
        while (reader.processNextEvent()) {
        }
        assertThat(buffer.size, "Unconsumed buffer: ${buffer.readUtf8()}")
          .isEqualTo(0)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

      private object SlowRequestBody : RequestBody() {
        override fun contentType(): MediaType? = null
    
        override fun writeTo(sink: BufferedSink) {
          for (i in 0 until 50) {
            sink.writeUtf8("abc")
            sink.flush()
            Thread.sleep(100)
          }
          fail("")
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top