- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for copyBuffer (0.25 sec)
-
src/io/io.go
func CopyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error) { if buf != nil && len(buf) == 0 { panic("empty buffer in CopyBuffer") } return copyBuffer(dst, src, buf) } // copyBuffer is the actual implementation of Copy and CopyBuffer. // if buf is nil, one is allocated. func copyBuffer(dst Writer, src Reader, buf []byte) (written int64, err error) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 15 17:34:10 UTC 2024 - 21.6K bytes - Viewed (0) -
src/io/io_test.go
rb := new(Buffer) wb := new(Buffer) rb.WriteString("hello, world.") CopyBuffer(wb, rb, make([]byte, 1)) // Tiny buffer to keep it honest. if wb.String() != "hello, world." { t.Errorf("CopyBuffer did not work properly") } } func TestCopyBufferNil(t *testing.T) { rb := new(Buffer) wb := new(Buffer) rb.WriteString("hello, world.") CopyBuffer(wb, rb, nil) // Should allocate a buffer. if wb.String() != "hello, world." {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 09 22:04:41 UTC 2023 - 18.9K bytes - Viewed (0) -
src/net/http/httputil/reverseproxy.go
var buf []byte if p.BufferPool != nil { buf = p.BufferPool.Get() defer p.BufferPool.Put(buf) } _, err := p.copyBuffer(w, src, buf) return err } // copyBuffer returns any write errors or non-EOF read errors, and the amount // of bytes written. func (p *ReverseProxy) copyBuffer(dst io.Writer, src io.Reader, buf []byte) (int64, error) { if len(buf) == 0 { buf = make([]byte, 32*1024) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 27 23:37:42 UTC 2024 - 24.9K bytes - Viewed (0) -
cmd/object-api-utils_test.go
r, idxCB := newS2CompressReader(bytes.NewReader(tt.data), int64(len(tt.data)), false) defer r.Close() var rdrBuf bytes.Buffer _, err := io.CopyBuffer(&rdrBuf, r, buf) if err != nil { t.Fatal(err) } r.Close() idx := idxCB() if !tt.wantIdx && len(idx) > 0 { t.Errorf("index returned above threshold") } if tt.wantIdx {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Fri May 24 23:05:23 UTC 2024 - 23.4K bytes - Viewed (0) -
internal/ioutil/ioutil.go
func Copy(dst io.Writer, src io.Reader) (written int64, err error) { bufp := copyBufPool.Get().(*[]byte) buf := *bufp defer copyBufPool.Put(bufp) return io.CopyBuffer(dst, src, buf) } // SameFile returns if the files are same. func SameFile(fi1, fi2 os.FileInfo) bool { if !os.SameFile(fi1, fi2) { return false } if !fi1.ModTime().Equal(fi2.ModTime()) {
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Wed May 22 23:07:14 UTC 2024 - 10.2K bytes - Viewed (0) -
src/vendor/golang.org/x/net/nettest/conntest.go
// connections like "unixpacket". // We assume that the maximum packet size is at least 1024. func chunkedCopy(w io.Writer, r io.Reader) error { b := make([]byte, 1024) _, err := io.CopyBuffer(struct{ io.Writer }{w}, struct{ io.Reader }{r}, b) return err
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 12.2K bytes - Viewed (0) -
cmd/storage-rest-server.go
if err != nil { return err } // Check if we have a response ready or a filler byte. switch tmp[0] { case 0: // 0 is unbuffered, copy the rest. _, err := io.CopyBuffer(w, respBody, buf) if err == io.EOF { return nil } return err case 1: errorText, err := io.ReadAll(respBody) if err != nil { return err }
Registered: Sun Jun 16 00:44:34 UTC 2024 - Last Modified: Mon Jun 10 15:51:27 UTC 2024 - 44.8K bytes - Viewed (0) -
src/net/http/transfer.go
// // This function is only intended for use in writeBody. func (t *transferWriter) doBodyCopy(dst io.Writer, src io.Reader) (n int64, err error) { buf := getCopyBuf() defer putCopyBuf(buf) n, err = io.CopyBuffer(dst, src, buf) if err != nil && err != io.EOF { t.bodyReadError = err } return } // unwrapBody unwraps the body's inner reader if it's a
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 21 22:14:00 UTC 2024 - 31.1K bytes - Viewed (0) -
src/archive/tar/reader_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 21 21:14:38 UTC 2022 - 47.1K bytes - Viewed (0) -
api/go1.5.txt
pkg image/gif, const DisposalPrevious ideal-int pkg image/gif, type GIF struct, BackgroundIndex uint8 pkg image/gif, type GIF struct, Config image.Config pkg image/gif, type GIF struct, Disposal []uint8 pkg io, func CopyBuffer(Writer, Reader, []uint8) (int64, error) pkg log, const LUTC = 32 pkg log, const LUTC ideal-int pkg log, func Output(int, string) error pkg log, method (*Logger) SetOutput(io.Writer) pkg math/big, const Above = 1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 30 21:14:09 UTC 2015 - 46.6K bytes - Viewed (0)