code: func newAppSec(marker byte, r io.Reader) (*appSec, error) {
  	br := bufio.NewReader(r)
  	app := &appSec{marker: marker}
  	var dataLen int
  
  	// seek to marker
  	for dataLen == 0 {
  		if _, err := br.ReadBytes(0xFF); err != nil {
  			return nil, err
  		}
  		c, err := br.ReadByte()
  		if err != nil {
  			return nil, err
  		} else if c != marker {
  			continue
  		}
  
  		dataLenBytes := make([]byte, 2)
  		for k, _ := range dataLenBytes {
  			c, err := br.ReadByte()
  			if err != nil {
  				return nil, err
  			}
  			dataLenBytes[k] = c
  		}
  		dataLen = int(binary.BigEndian.Uint16(dataLenBytes)) - 2
  	}
  
  	// read section data
  	nread := 0
  	for nread < dataLen {
  		s := make([]byte, dataLen-nread)
  		n, err := br.Read(s)
  		nread += n
  		if err != nil && nread < dataLen {
  			return nil, err
  		}
  		app.data = append(app.data, s[:n]...)
  	}
  	return app, nil
  }
docs: // newAppSec finds marker in r and returns the corresponding application data
  // section.