Esempio n. 1
0
func LoadParts(r *resource.Resource) (*FileParts, error) {
	m, e := r.Open("parts")
	if e != nil {
		return nil, e
	}
	f := new(FileParts)
	defer m.Close()
	dec := gob.NewDecoder(io.NewSectionReader(m, 0, MB64))
	e = dec.Decode(f)
	return f, e
}
Esempio n. 2
0
func LoadDPs(r *resource.Resource, part string) (*DirPage, error) {
	m, e := r.Open(part + "inf")
	if e != nil {
		return nil, e
	}
	f := new(DirPage)
	defer m.Close()
	dec := gob.NewDecoder(io.NewSectionReader(m, 0, MB64))
	e = dec.Decode(f)
	return f, e
}
Esempio n. 3
0
func LoadMeta(r *resource.Resource) (*FileMetadata, error) {
	m, e := r.Open("meta")
	if e != nil {
		return nil, e
	}
	f := new(FileMetadata)
	defer m.Close()
	dec := gob.NewDecoder(io.NewSectionReader(m, 0, MB64))
	e = dec.Decode(f)
	return f, e
}