func NewDemofile(file string, isDebug bool) (*Demofile, error) {
	readFile, err := os.Open(file)
	if err != nil {
		return nil, err
	}

	stat, err := readFile.Stat()
	if err != nil {
		return nil, err
	}

	return &Demofile{
		file:    readFile,
		size:    stat.Size(),
		buf:     make([]byte, stat.Size()),
		parser:  NewParser(isDebug),
		isDebug: isDebug,
	}, nil
}
// NewDemofile creates Demofile structs with basis things
NewDemofile creates Demofile structs with basis things
// NewDemofile creates Demofile structs with basis things
func NewDemofile(file string, isDebug bool) (*Demofile, error) {
	readFile, err := os.Open(file)
	if err != nil {
		return nil, err
	}
	stat, err := readFile.Stat()
	if err != nil {
		return nil, err
	}
	return &Demofile{
		file:    readFile,
		size:    stat.Size(),
		buf:     make([]byte, stat.Size()),
		parser:  NewParser(isDebug),
		isDebug: isDebug,
	}, nil
}
func NewDemofile ( file string , isDebug bool ) ( * Demofile , error ) { readFile , err := os . Open ( file ) if err != nil { return nil , err } stat , err := readFile . Stat ( ) if err != nil { return nil , err } return & Demofile { file : readFile , size : stat . Size ( ) , buf : make ( [ ] byte , stat . Size ( ) ) , parser : NewParser ( isDebug ) , isDebug : isDebug , } , nil }
NewDemofile creates Demofile structs with basis things
NewDemofile creates Demofile structs with basis things