code: func (s *stream) ingestBundleEntry(be *logpb.ButlerLogBundle_Entry) (closed bool, err error) {
  	for _, le := range be.GetLogs() {
  		curFile, err := s.getCurFile()
  		if err != nil {
  			return false, err
  		}
  
  		switch x := le.Content.(type) {
  		case *logpb.LogEntry_Datagram:
  			dg := x.Datagram
  			_, err = s.curFile.Write(dg.Data)
  			if err == nil {
  				if dg.Partial == nil || dg.Partial.Last {
  					s.closeCurFile()
  				}
  			}
  		case *logpb.LogEntry_Text:
  			for _, line := range x.Text.Lines {
  				_, err = curFile.Write(line.Value)
  				if err == nil {
  					_, err = curFile.WriteString("\n")
  				}
  			}
  		case *logpb.LogEntry_Binary:
  			_, err = curFile.Write(x.Binary.Data)
  		}
  
  		if err != nil {
  			return false, err
  		}
  	}
  	if be.Terminal {
  		s.Close()
  		return true, nil
  	}
  	return false, nil
  }
docs: // ingestBundleEntry writes the data from `be` to disk
  //
  // Returns closed == true if `be` was terminal and the stream can be closed now.