Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for format (0.2 sec)

  1. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

        assertData("827e") // 'e' == 4-byte follow-up length.
        assertData(format("%04X", payload.completeSegmentByteCount()))
        assertData(payload.readByteString())
      }
    
      @Test fun serverMessageLengthLong() {
        // Create a payload which will overflow the normal and short payload byte size.
        val payload = Buffer()
        while (payload.completeSegmentByteCount() <= PAYLOAD_SHORT_MAX) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

        if (!basePath.endsWith("/")) basePath += "/";
    
        StringBuilder response = new StringBuilder();
        response.append(String.format("<html><head><title>%s</title></head><body>", basePath));
        response.append(String.format("<h1>%s</h1>", basePath));
        for (String file : directory.list()) {
          response.append(String.format("<div class='file'><a href='%s'>%s</a></div>",
              basePath + file, file));
        }
        response.append("</body></html>");
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/PostStreaming.java

          @Override public void writeTo(BufferedSink sink) throws IOException {
            sink.writeUtf8("Numbers\n");
            sink.writeUtf8("-------\n");
            for (int i = 2; i <= 997; i++) {
              sink.writeUtf8(String.format(" * %s = %s\n", i, factor(i)));
            }
          }
    
          private String factor(int n) {
            for (int i = 2; i < n; i++) {
              int x = n / i;
              if (x * i == n) return factor(x) + " × " + i;
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Fri Jul 06 03:18:15 GMT 2018
    - 2.1K bytes
    - Viewed (0)
  4. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

     * [application interceptor][OkHttpClient.interceptors] or as a [OkHttpClient.networkInterceptors].
     *
     * The format of the logs created by this class should not be considered stable and may
     * change slightly between releases. If you need a stable logging format, use your own interceptor.
     */
    class HttpLoggingInterceptor
      @JvmOverloads
      constructor(
        private val logger: Logger = Logger.DEFAULT,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  5. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

    import okio.Path.Companion.toPath
    import okio.buffer
    import okio.gzip
    
    /**
     * Downloads the public suffix list from https://publicsuffix.org/list/public_suffix_list.dat and
     * transforms the file into an efficient format used by OkHttp.
     *
     *
     * The intent is to use this class to update the list periodically by manually running the main
     * method. This should be run from the top-level okhttp directory.
     *
     *
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
  6. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

      @Test
      fun `parse generalized time with fractional seconds`() {
        assertThat(Adapters.parseGeneralizedTime("19920722132100.3Z"))
          .isEqualTo(date("1992-07-22T13:21:00.300+0000").time)
      }
    
      @Test fun `format generalized time`() {
        assertThat(Adapters.formatGeneralizedTime(date("1899-01-01T00:00:00.000+0000").time))
          .isEqualTo("18990101000000Z")
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/RecordedResponse.kt

      private fun assertDateInRange(
        minimum: Long,
        actual: Long,
        maximum: Long,
      ) {
        assertThat(actual, "${format(minimum)} <= ${format(actual)} <= ${format(maximum)}")
          .isBetween(minimum, maximum)
      }
    
      private fun format(time: Long) = SimpleDateFormat("HH:mm:ss.SSS").format(Date(time))
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2.kt

        val direction = if (inbound) "<<" else ">>"
        return format(
          "%s 0x%08x %5d %-13s %d",
          direction,
          streamId,
          length,
          formattedType,
          windowSizeIncrement,
        )
      }
    
      internal fun formattedType(type: Int): String = if (type < FRAME_NAMES.size) FRAME_NAMES[type] else format("0x%02x", type)
    
      /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/Progress.java

                  System.out.println("content-length: unknown");
                } else {
                  System.out.format("content-length: %d\n", contentLength);
                }
              }
    
              System.out.println(bytesRead);
    
              if (contentLength != -1) {
                System.out.format("%d%% done\n", (100 * bytesRead) / contentLength);
              }
            }
          }
        };
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 3.9K bytes
    - Viewed (0)
  10. okhttp-hpacktests/src/test/java/okhttp3/internal/http2/hpackjson/Case.kt

     * limitations under the License.
     */
    package okhttp3.internal.http2.hpackjson
    
    import okhttp3.internal.http2.Header
    import okio.ByteString
    
    /**
     * Representation of an individual case (set of headers and wire format). There are many cases for a
     * single story.  This class is used reflectively with Moshi to parse stories.
     */
    data class Case(
      val seqno: Int = 0,
      val wire: ByteString? = null,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Dec 23 10:26:25 GMT 2023
    - 1.3K bytes
    - Viewed (0)
Back to top