-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathzerocopy_other.go
More file actions
41 lines (31 loc) · 823 Bytes
/
Copy pathzerocopy_other.go
File metadata and controls
41 lines (31 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2019 Andrei Tudor Călin <mail@acln.ro>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !linux
package zerocopy
import (
"errors"
"io"
)
func (p *Pipe) bufferSize() (int, error) {
return 0, errors.New("not supported")
}
func (p *Pipe) setBufferSize(n int) error {
return errors.New("not supported")
}
func (p *Pipe) read(b []byte) (n int, err error) {
return p.teerd.Read(b)
}
func (p *Pipe) readFrom(src io.Reader) (int64, error) {
return io.Copy(p.w, src)
}
func (p *Pipe) writeTo(dst io.Writer) (int64, error) {
return io.Copy(dst, p.r)
}
func transfer(dst io.Writer, src io.Reader) (int64, error) {
return io.Copy(dst, src)
}
func (p *Pipe) tee(w io.Writer) {
p.teerd = io.TeeReader(p.r, w)
}