Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 129 for read_all (0.27 sec)

  1. src/archive/zip/zip_test.go

    	rc.(*checksumReader).hash = fakeHash32{}
    	for i := 0; i < chunks; i++ {
    		_, err := io.ReadFull(rc, chunk)
    		if err != nil {
    			t.Fatal("read:", err)
    		}
    	}
    	if frag := int(size % chunkSize); frag > 0 {
    		_, err := io.ReadFull(rc, chunk[:frag])
    		if err != nil {
    			t.Fatal("read:", err)
    		}
    	}
    	gotEnd, err := io.ReadAll(rc)
    	if err != nil {
    		t.Fatal("read end:", err)
    	}
    	if !bytes.Equal(gotEnd, end) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  2. cmd/metacache-stream.go

    			continue
    		}
    		res = append(res, meta)
    	}
    	return metaCacheEntriesSorted{o: res}, nil
    }
    
    // readAll will return all remaining objects on the dst channel and close it when done.
    // The context allows the operation to be canceled.
    func (r *metacacheReader) readAll(ctx context.Context, dst chan<- metaCacheEntry) error {
    	r.checkInit()
    	if r.err != nil {
    		return r.err
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  3. cmd/xl-storage.go

    		buf = buf[:sz]
    	} else {
    		buf = make([]byte, sz)
    	}
    
    	// Read file...
    	_, err = io.ReadFull(f, buf)
    
    	return buf, stat.ModTime().UTC(), osErrToFileErr(err)
    }
    
    // ReadAll is a raw call, reads content at any path and returns the buffer.
    func (s *xlStorage) ReadAll(ctx context.Context, volume string, path string) (buf []byte, err error) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 84.7K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/http/ExchangeCodec.kt

     */
    package okhttp3.internal.http
    
    import java.io.IOException
    import okhttp3.Headers
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.Route
    import okhttp3.internal.connection.RealCall
    import okio.Sink
    import okio.Source
    
    /** Encodes HTTP requests and decodes HTTP responses. */
    interface ExchangeCodec {
      /** The connection or CONNECT tunnel that owns this codec. */
      val carrier: Carrier
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3K bytes
    - Viewed (0)
  5. internal/config/crypto_test.go

    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    		data, err := io.ReadAll(ciphertext)
    		if err != nil {
    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    
    		plaintext, err := Decrypt(KMS, bytes.NewReader(data), test.Context)
    		if err != nil {
    			t.Fatalf("Test %d: failed to decrypt stream: %v", i, err)
    		}
    		data, err = io.ReadAll(plaintext)
    		if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.2K bytes
    - Viewed (0)
  6. src/bytes/reader_test.go

    	r.Reset([]byte(want))
    	if err := r.UnreadRune(); err == nil {
    		t.Errorf("UnreadRune: expected error, got nil")
    	}
    	buf, err := io.ReadAll(r)
    	if err != nil {
    		t.Errorf("ReadAll: unexpected error: %v", err)
    	}
    	if got := string(buf); got != want {
    		t.Errorf("ReadAll: got %q, want %q", got, want)
    	}
    }
    
    func TestReaderZero(t *testing.T) {
    	if l := (&Reader{}).Len(); l != 0 {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Dec 13 18:45:54 GMT 2021
    - 8K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/RecordingExecutor.kt

    import java.util.concurrent.TimeUnit
    import okhttp3.internal.connection.RealCall
    import okhttp3.internal.finishedAccessor
    
    internal class RecordingExecutor(
      private val dispatcherTest: DispatcherTest,
    ) : AbstractExecutorService() {
      private var shutdown: Boolean = false
      private val calls = mutableListOf<RealCall.AsyncCall>()
    
      override fun execute(command: Runnable) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/kt/PostPath.kt

            .build()
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          fileSystem.sink(path).use {
            response.body.source().readAll(it)
          }
    
          println(fileSystem.source(path).buffer().readUtf8())
        }
      }
    
      companion object {
        val MEDIA_TYPE_JSON = "application/json".toMediaType()
      }
    }
    
    fun main() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  9. src/archive/zip/fuzz_test.go

    		type file struct {
    			header  *FileHeader
    			content []byte
    		}
    		files := []file{}
    
    		for _, f := range r.File {
    			fr, err := f.Open()
    			if err != nil {
    				continue
    			}
    			content, err := io.ReadAll(fr)
    			if err != nil {
    				continue
    			}
    			files = append(files, file{header: &f.FileHeader, content: content})
    			if _, err := r.Open(f.Name); err != nil {
    				continue
    			}
    		}
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jan 13 18:06:33 GMT 2022
    - 1.7K bytes
    - Viewed (0)
  10. docs/auditlog/auditlog-echo.go

    	"io"
    	"log"
    	"net/http"
    )
    
    var port int
    
    func init() {
    	flag.IntVar(&port, "port", 8080, "Port to listen on")
    }
    
    func mainHandler(w http.ResponseWriter, r *http.Request) {
    	body, err := io.ReadAll(r.Body)
    	defer r.Body.Close()
    	if err != nil {
    		log.Printf("Error reading request body: %v", err)
    		w.WriteHeader(http.StatusBadRequest)
    		return
    	}
    
    	log.Printf(">>> %s %s\n", r.Method, r.URL.Path)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 21:31:13 GMT 2024
    - 1.5K bytes
    - Viewed (0)
Back to top