- Sort Score
- Result 10 results
- Languages All
Results 551 - 560 of 657 for fun (0.03 sec)
-
okhttp/src/test/java/okhttp3/internal/http/ExternalHttp2Example.kt
* limitations under the License. */ package okhttp3.internal.http import okhttp3.OkHttpClient import okhttp3.Protocol import okhttp3.Request object ExternalHttp2Example { @JvmStatic fun main(args: Array<String>) { val client = OkHttpClient.Builder() .protocols(listOf(Protocol.HTTP_2, Protocol.HTTP_1_1)) .build() val call = client.newCall( Request.Builder()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.4K bytes - Viewed (0) -
mockwebserver/src/main/kotlin/mockwebserver3/internal/TriggerSink.kt
*/ internal class TriggerSink( private val delegate: Sink, private val triggerByteCount: Long, private val trigger: () -> Unit, ) : Sink by delegate { private var bytesWritten = 0L override fun write( source: Buffer, byteCount: Long, ) { if (byteCount == 0L) return // Avoid double-triggering. if (bytesWritten == triggerByteCount) { source.skip(byteCount) return }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.4K bytes - Viewed (0) -
okhttp-brotli/src/main/kotlin/okhttp3/brotli/BrotliInterceptor.kt
* responses. n.b. this replaces the transparent gzip compression in BridgeInterceptor. */ object BrotliInterceptor : Interceptor { override fun intercept(chain: Interceptor.Chain): Response { return if (chain.request().header("Accept-Encoding") == null) { val request = chain.request().newBuilder() .header("Accept-Encoding", "br,gzip")
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.3K bytes - Viewed (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/internal/IsProbablyUtf8.kt
import okio.Buffer /** * Returns true if the body in question probably contains human readable text. Uses a small * sample of code points to detect unicode control characters commonly used in binary file * signatures. */ fun Buffer.isProbablyUtf8(): Boolean { try { val prefix = Buffer() val byteCount = size.coerceAtMost(64) copyTo(prefix, 0, byteCount) for (i in 0 until 16) { if (prefix.exhausted()) { break
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 07 16:05:34 UTC 2024 - 1.4K bytes - Viewed (0) -
samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt
* Baseline test if we ned to validate OkHttp behaviour against other popular clients. */ class ApacheHttpClientTest { private val httpClient = HttpClients.createDefault() @AfterEach fun tearDown() { httpClient.close() } @Test fun get(server: MockWebServer) { server.enqueue( MockResponse.Builder() .body("hello, Apache HttpClient 5.x") .build(), )
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 2.1K bytes - Viewed (0) -
mockwebserver/src/main/kotlin/mockwebserver3/internal/SleepNanos.kt
* See the License for the specific language governing permissions and * limitations under the License. * */ package mockwebserver3.internal internal fun sleepNanos(nanos: Long) { val ms = nanos / 1_000_000L val ns = nanos - (ms * 1_000_000L) if (ms > 0L || nanos > 0) { Thread.sleep(ms, ns.toInt()) }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 07 16:05:34 UTC 2024 - 811 bytes - Viewed (0) -
okcurl/src/main/kotlin/okhttp3/curl/logging/MessageFormatter.kt
* limitations under the License. */ package okhttp3.curl.logging import java.util.logging.LogRecord import java.util.logging.SimpleFormatter object MessageFormatter : SimpleFormatter() { override fun format(record: LogRecord): String { return String.format("%s%n", record.message) }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Fri Apr 05 03:30:42 UTC 2024 - 860 bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/OkHttpTest.kt
* limitations under the License. */ package okhttp3 import assertk.assertThat import assertk.assertions.matches import org.junit.jupiter.api.Test class OkHttpTest { @Test fun testVersion() { assertThat(OkHttp.VERSION).matches(Regex("[0-9]+\\.[0-9]+\\.[0-9]+(-.+)?")) }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Dec 21 01:54:49 UTC 2023 - 848 bytes - Viewed (0) -
okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/Case.kt
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Dec 23 10:26:25 UTC 2023 - 1.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/eventbus/StringCatcher.java
import java.util.List; import junit.framework.Assert; import org.checkerframework.checker.nullness.qual.Nullable; /** * A simple EventSubscriber mock that records Strings. * * <p>For testing fun, also includes a landmine method that EventBus tests are required not * to call ({@link #methodWithoutAnnotation(String)}). * * @author Cliff Biffle */ public class StringCatcher {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed May 16 22:49:59 UTC 2018 - 1.4K bytes - Viewed (0)