- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for NewBuffer (0.06 sec)
-
src/bufio/bufio_test.go
srcBuf := bytes.NewBuffer(make([]byte, 8192)) src := NewReader(onlyReader{srcBuf}) dstBuf := new(bytes.Buffer) dst := onlyWriter{dstBuf} for i := 0; i < b.N; i++ { srcBuf.Reset() src.Reset(onlyReader{srcBuf}) dstBuf.Reset() io.Copy(dst, src) } } func BenchmarkReaderCopyNoWriteTo(b *testing.B) { srcBuf := bytes.NewBuffer(make([]byte, 8192))
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Nov 01 21:52:12 UTC 2024 - 51.6K bytes - Viewed (0) -
cmd/test-utils_test.go
if err != nil { t.Fatal(failTestStr(anonTestStr, err.Error())) } // creating 2 read closer (to set as request body) from the body content. readerOne := io.NopCloser(bytes.NewBuffer(buf)) readerTwo := io.NopCloser(bytes.NewBuffer(buf)) anonReq.Body = readerOne // call the HTTP handler. apiRouter.ServeHTTP(rec, anonReq) // expected error response when the unsigned HTTP request is not permitted.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Oct 01 22:13:18 UTC 2024 - 77K bytes - Viewed (0) -
cmd/erasure-object.go
for i, disk := range onlineDisks { if disk == nil { continue } if disk.IsOnline() { buf := grid.GetByteBufferCap(int(erasure.ShardFileSize(data.Size())) + 64) inlineBuffers[i] = bytes.NewBuffer(buf[:0]) defer grid.PutByteBuffer(buf) writers[i] = newStreamingBitrotWriterBuffer(inlineBuffers[i], DefaultBitrotAlgorithm, erasure.ShardSize()) } }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Oct 31 22:10:24 UTC 2024 - 78.8K bytes - Viewed (0) -
cmd/peer-rest-server.go
}) if err != nil { return grid.NewRemoteErr(err) } // Process until remote disconnects. // Blocks on upstream (out) congestion. // We have however a dynamic downstream buffer (ch). buf := bytes.NewBuffer(grid.GetByteBuffer()) enc := json.NewEncoder(buf) tmpEvt := struct{ Records []event.Event }{[]event.Event{{}}} for { select { case <-ctx.Done(): grid.PutByteBuffer(buf.Bytes()) return nil
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Oct 04 11:32:32 UTC 2024 - 53.2K bytes - Viewed (0) -
src/archive/zip/reader_test.go
if err != ErrFormat { t.Fatalf("unexpected error, got: %v, want: %v", err, ErrFormat) } // Also check that an archive containing a handful of empty // files doesn't cause an issue b := bytes.NewBuffer(nil) w := NewWriter(b) for i := 0; i < 5; i++ { _, err := w.Create("") if err != nil { t.Fatalf("Writer.Create failed: %s", err) } } if err := w.Close(); err != nil {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Jul 25 00:25:45 UTC 2024 - 55.6K bytes - Viewed (0) -
cmd/erasure-server-pool.go
var r io.ReadCloser if !si.Dir { r, err = disk.ReadFileStream(ctx, volume, si.Name, 0, si.Size) if err != nil { continue } } else { r = io.NopCloser(bytes.NewBuffer([]byte{})) } // Keep disk path instead of ID, to ensure that the downloaded zip file can be // easily automated with `minio server hostname{1...n}/disk{1...m}`.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Sep 29 22:40:36 UTC 2024 - 89.8K bytes - Viewed (0)