FlacMetadataReader { public static boolean checkAndPeekStreamMarker(ExtractorInput input) throws IOException, InterruptedException { ParsableByteArray scratch = new ParsableByteArray(FlacConstants.STREAM_MARKER_SIZE); input.peekFully(scratch.data, 0, FlacConstants.STREAM_MARKER_SIZE); return scratch.readUnsignedInt() == STREAM_MARKER; } private  FlacMetadataReader(); @Nullable static Metadata peekId3Metadata(ExtractorInput input, boolean parseData); static boolean checkAndPeekStreamMarker(ExtractorInput input); @Nullable static Metadata readId3Metadata(ExtractorInput input, boolean parseData); static void readStreamMarker(ExtractorInput input); static boolean readMetadataBlock(
      ExtractorInput input, FlacStreamMetadataHolder metadataHolder); static FlacStreamMetadata.SeekTable readSeekTableMetadataBlock(ParsableByteArray data); static int getFrameStartMarker(ExtractorInput input);  }
@Test public void checkAndPeekStreamMarker_updatesPeekPosition() throws Exception { ExtractorInput input = buildExtractorInput("flac/bear.flac"); FlacMetadataReader.checkAndPeekStreamMarker(input); assertThat(input.getPosition()).isEqualTo(0); assertThat(input.getPeekPosition()).isEqualTo(FlacConstants.STREAM_MARKER_SIZE); }
@Test public void checkAndPeekStreamMarker_validData_isTrue() throws Exception { ExtractorInput input = buildExtractorInput("flac/bear.flac"); boolean result = FlacMetadataReader.checkAndPeekStreamMarker(input); assertThat(result).isTrue(); }
@Test public void checkAndPeekStreamMarker_invalidData_isFalse() throws Exception { ExtractorInput input = buildExtractorInput("mp3/bear.mp3"); boolean result = FlacMetadataReader.checkAndPeekStreamMarker(input); assertThat(result).isFalse(); }