mirror of
https://github.com/pion/mediadevices.git
synced 2025-10-05 08:36:55 +08:00
12 lines
268 B
Go
12 lines
268 B
Go
package io
|
|
|
|
// Copy copies data from src to dst. If dst is not big enough, return an
|
|
// InsufficientBufferError.
|
|
func Copy(dst, src []byte) (n int, err error) {
|
|
if len(dst) < len(src) {
|
|
return 0, &InsufficientBufferError{len(src)}
|
|
}
|
|
|
|
return copy(dst, src), nil
|
|
}
|