Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for FileOperator (0.17 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache2/FileOperator.kt

     *  * **Shared channels:** read and write a file channel that's shared between
     * multiple operators. Note that although the underlying [FileChannel] may be shared,
     * each [FileOperator] should not be.
     */
    internal class FileOperator(
      private val fileChannel: FileChannel,
    ) {
      /** Write [byteCount] bytes from [source] to the file at [pos]. */
      @Throws(IOException::class)
      fun write(
        pos: Long,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/cache2/FileOperatorTest.kt

        val operator =
          FileOperator(
            randomAccessFile!!.getChannel(),
          )
        val buffer = Buffer()
        operator.read(0, buffer, 5)
        assertThat(buffer.readUtf8()).isEqualTo("Hello")
        operator.read(4, buffer, 5)
        assertThat(buffer.readUtf8()).isEqualTo("o, Wo")
      }
    
      @Test
      fun write() {
        val operator =
          FileOperator(
            randomAccessFile!!.getChannel(),
          )
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/cache2/Relay.kt

          }
    
        val fileOperator = FileOperator(file!!.channel)
        fileOperator.write(0, header, FILE_HEADER_SIZE)
      }
    
      @Throws(IOException::class)
      private fun writeMetadata(upstreamSize: Long) {
        val metadataBuffer = Buffer()
        metadataBuffer.write(metadata)
    
        val fileOperator = FileOperator(file!!.channel)
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.8K bytes
    - Viewed (0)
Back to top