@Test
public void checkAndReadFrameHeader_validData_updatesPosition() throws Exception {

  FlacStreamMetadataHolder streamMetadataHolder =
      new FlacStreamMetadataHolder(/* flacStreamMetadata= */ null);
  ExtractorInput input =
      buildExtractorInputReadingFromFirstFrame(
          "flac/bear_one_metadata_block.flac", streamMetadataHolder);
  int frameStartMarker = FlacMetadataReader.getFrameStartMarker(input);
  ParsableByteArray scratch = new ParsableByteArray(FlacConstants.MAX_FRAME_HEADER_SIZE);
  input.read(scratch.data, 0, FlacConstants.MAX_FRAME_HEADER_SIZE);
  FlacFrameReader.checkAndReadFrameHeader(
      scratch,
      streamMetadataHolder.flacStreamMetadata,
      frameStartMarker,
      new SampleNumberHolder());
  assertThat(scratch.getPosition()).isEqualTo(FlacConstants.MIN_FRAME_HEADER_SIZE);
}