func (d *Demofile) Start() error {
	defer d.file.Close()

	for {
		n, err := d.file.Read(d.buf)
		if err != nil {
			if err == io.EOF {
				break
			}

			return err
		}

		if d.isDebug {
			fmt.Println("Written bytes:", n)
		}

		bufToParse := make([]byte, n)
		copy(bufToParse, d.buf)

		err = d.parser.Parse(bufToParse)
		if err != nil {
			return err
		}
	}

	return nil
}
// Start starts moving via demofile and execute events
Start starts moving via demofile and execute events
// Start starts moving via demofile and execute events
func (d *Demofile) Start() error {
	defer d.file.Close()
	for {
		n, err := d.file.Read(d.buf)
		if err != nil {
			if err == io.EOF {
				break
			}
			return err
		}
		if d.isDebug {
			fmt.Println("Written bytes:", n)
		}
		bufToParse := make([]byte, n)
		copy(bufToParse, d.buf)
		err = d.parser.Parse(bufToParse)
		if err != nil {
			return err
		}
	}
	return nil
}
func ( d * Demofile ) Start ( ) error { defer d . file . Close ( ) for { n , err := d . file . Read ( d . buf ) if err != nil { if err == io . EOF { break } return err } if d . isDebug { fmt . Println ( " " , n ) } bufToParse := make ( [ ] byte , n ) copy ( bufToParse , d . buf ) err = d . parser . Parse ( bufToParse ) if err != nil { return err } } return nil }
Start starts moving via demofile and execute events
Start starts moving via demofile and execute events