MCPcopy Index your code
hub / github.com/g3n/engine / loadFileBytes

Method loadFileBytes

loader/gltf/loader.go:1111–1126  ·  view source on GitHub ↗

loadFileBytes loads the file with specified path as a byte array.

(uri string)

Source from the content-addressed store, hash-verified

1109
1110// loadFileBytes loads the file with specified path as a byte array.
1111func (g *GLTF) loadFileBytes(uri string) ([]byte, error) {
1112
1113 log.Debug("Loading File: %v", uri)
1114
1115 fpath := filepath.Join(g.path, uri)
1116 f, err := os.Open(fpath)
1117 if err != nil {
1118 return nil, err
1119 }
1120 defer f.Close()
1121 data, err := ioutil.ReadAll(f)
1122 if err != nil {
1123 return nil, err
1124 }
1125 return data, nil
1126}
1127
1128// dataURL describes a decoded data url string.
1129type dataURL struct {

Callers 2

LoadImageMethod · 0.95
loadBufferMethod · 0.95

Calls 2

DebugMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected