FlacMetadataReader { public static void readStreamMarker(ExtractorInput input) throws IOException, InterruptedException { ParsableByteArray scratch = new ParsableByteArray(FlacConstants.STREAM_MARKER_SIZE); input.readFully(scratch.data, 0, FlacConstants.STREAM_MARKER_SIZE); if (scratch.readUnsignedInt() != STREAM_MARKER) { throw new ParserException("Failed to read FLAC 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 readStreamMarker_updatesReadPosition() throws Exception { ExtractorInput input = buildExtractorInput("flac/bear.flac"); FlacMetadataReader.readStreamMarker(input); assertThat(input.getPosition()).isEqualTo(FlacConstants.STREAM_MARKER_SIZE); assertThat(input.getPeekPosition()).isEqualTo(input.getPosition()); }
@Test(expected = ParserException.class) public void readStreamMarker_invalidData_throwsException() throws Exception { ExtractorInput input = buildExtractorInput("mp3/bear.mp3"); FlacMetadataReader.readStreamMarker(input); }