mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 10:07:24 +08:00
mount: shortcut when there is only one chunk
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/md5"
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
@@ -148,3 +149,15 @@ func RandomBytes(byteCount int) []byte {
|
||||
rand.Read(buf)
|
||||
return buf
|
||||
}
|
||||
|
||||
type BytesReader struct {
|
||||
Bytes []byte
|
||||
*bytes.Reader
|
||||
}
|
||||
|
||||
func NewBytesReader(b []byte) *BytesReader {
|
||||
return &BytesReader{
|
||||
Bytes: b,
|
||||
Reader: bytes.NewReader(b),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user