- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for nextBytes (0.15 sec)
-
okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt
assertThat(actual).isEqualTo(expected) } companion object { private fun binaryData(length: Int): ByteString { val junk = ByteArray(length) Random(0).nextBytes(junk) return junk.toByteString() } }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 9.3K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/cache2/FileOperatorTest.kt
assertFailsWith<IndexOutOfBoundsException> { operator.write(0, buffer, 4L) } } private fun randomByteString(byteCount: Int): ByteString { val bytes = ByteArray(byteCount) Random(0).nextBytes(bytes) return ByteString.of(*bytes) } private fun snapshot(): ByteString { randomAccessFile!!.getChannel().force(false) val source = file!!.source().buffer() return source.readByteString()
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 5.8K bytes - Viewed (0) -
samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java
listeners.put(state, listener); } return slackApi.authorizeUrl(scopes, redirectUrl(), state, team); } private ByteString randomToken() { byte[] bytes = new byte[16]; secureRandom.nextBytes(bytes); return ByteString.of(bytes); } private HttpUrl redirectUrl() { return mockWebServer.url("/oauth/"); }
Java - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Thu Aug 12 07:26:27 GMT 2021 - 3.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/ws/WebSocketReaderTest.kt
}.also { expected -> assertThat(expected.message!!).contains("closed") } } private fun binaryData(length: Int): ByteString { val junk = ByteArray(length) random.nextBytes(junk) return junk.toByteString() }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 14.4K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt
} val b0 = B0_FLAG_FIN or opcode sinkBuffer.writeByte(b0) var b1 = length if (isClient) { b1 = b1 or B1_FLAG_MASK sinkBuffer.writeByte(b1) random.nextBytes(maskKey!!) sinkBuffer.write(maskKey) if (length > 0) { val payloadStart = sinkBuffer.size sinkBuffer.write(payload) sinkBuffer.readAndWriteUnsafe(maskCursor!!)
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 5.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http2/HuffmanTest.kt
for (i in s.indices) { assertRoundTrip(s.substring(0, i).encodeUtf8()) } val random = Random(123456789L) val buf = ByteArray(4096) random.nextBytes(buf) assertRoundTrip(buf.toByteString()) } private fun assertRoundTrip(data: ByteString) { val encodeBuffer = Buffer() encode(data, encodeBuffer)
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Thu Jan 04 05:32:07 GMT 2024 - 1.8K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/ws/RealWebSocket.kt
private var awaitingPong = false init { require("GET" == originalRequest.method) { "Request must be GET: ${originalRequest.method}" } this.key = ByteArray(16).apply { random.nextBytes(this) }.toByteString().base64() } override fun request(): Request = originalRequest @Synchronized override fun queueSize(): Long = queueSize override fun cancel() { call!!.cancel() }
Plain Text - Registered: Fri May 03 11:42:14 GMT 2024 - Last Modified: Mon Apr 01 14:21:25 GMT 2024 - 22.1K bytes - Viewed (0)