2019-02-04 02:17:56 +00:00
|
|
|
package asset
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AssetFile struct {
|
|
|
|
reader io.Reader
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewAssetFile(data []byte) AssetFile {
|
|
|
|
return AssetFile{bytes.NewReader(data)}
|
|
|
|
}
|
|
|
|
|
2019-02-24 06:14:12 +00:00
|
|
|
func (a AssetFile) Read(p []byte) (n int, err error) {
|
|
|
|
return a.reader.Read(p)
|
2019-02-04 02:17:56 +00:00
|
|
|
}
|
|
|
|
|
2019-02-24 06:14:12 +00:00
|
|
|
func (a AssetFile) Close() error {
|
2019-02-04 02:17:56 +00:00
|
|
|
return nil
|
|
|
|
}
|