code: func readNextChunk(r wire.SyncScanner) (io.Reader, error) {
  	status, err := r.ReadStatus("read-chunk")
  	if err != nil {
  		if wire.IsAdbServerErrorMatching(err, readFileNotFoundPredicate) {
  			return nil, errors.Errorf(errors.FileNoExistError, "no such file or directory")
  		}
  		return nil, err
  	}
  
  	switch status {
  	case wire.StatusSyncData:
  		return r.ReadBytes()
  	case wire.StatusSyncDone:
  		return nil, io.EOF
  	default:
  		return nil, errors.Errorf(errors.AssertionError, "expected chunk id '%s' or '%s', but got '%s'",
  			wire.StatusSyncData, wire.StatusSyncDone, []byte(status))
  	}
  }
docs: // readNextChunk creates an io.LimitedReader for the next chunk of data,
  // and returns io.EOF if the last chunk has been read.