nolint:cyclop
(r util.Reader)
| 570 | |
| 571 | //nolint:cyclop |
| 572 | func readStreamsInfo(r util.Reader) (*streamsInfo, error) { |
| 573 | s := new(streamsInfo) |
| 574 | |
| 575 | id, err := r.ReadByte() |
| 576 | if err != nil { |
| 577 | return nil, fmt.Errorf("readStreamsInfo: ReadByte error: %w", err) |
| 578 | } |
| 579 | |
| 580 | if id == idPackInfo { |
| 581 | if s.packInfo, err = readPackInfo(r); err != nil { |
| 582 | return nil, err |
| 583 | } |
| 584 | |
| 585 | id, err = r.ReadByte() |
| 586 | if err != nil { |
| 587 | return nil, fmt.Errorf("readStreamsInfo: ReadByte error: %w", err) |
| 588 | } |
| 589 | } |
| 590 | |
| 591 | if id == idUnpackInfo { |
| 592 | if s.unpackInfo, err = readUnpackInfo(r); err != nil { |
| 593 | return nil, err |
| 594 | } |
| 595 | |
| 596 | id, err = r.ReadByte() |
| 597 | if err != nil { |
| 598 | return nil, fmt.Errorf("readStreamsInfo: ReadByte error: %w", err) |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | if id == idSubStreamsInfo { |
| 603 | if s.unpackInfo == nil { |
| 604 | return nil, errMissingUnpackInfo |
| 605 | } |
| 606 | |
| 607 | if s.subStreamsInfo, err = readSubStreamsInfo(r, s.unpackInfo.folder); err != nil { |
| 608 | return nil, err |
| 609 | } |
| 610 | |
| 611 | id, err = r.ReadByte() |
| 612 | if err != nil { |
| 613 | return nil, fmt.Errorf("readStreamsInfo: ReadByte error: %w", err) |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | if id != idEnd { |
| 618 | return nil, errUnexpectedID |
| 619 | } |
| 620 | |
| 621 | return s, nil |
| 622 | } |
| 623 | |
| 624 | func readTimes(r util.Reader, count uint64) ([]time.Time, error) { |
| 625 | if err := checkUint64(count, true); err != nil { |
no test coverage detected
searching dependent graphs…