@Test
public void testGetAudioFileFormatWithBufferedFlacStream() throws UnsupportedAudioFileException, IOException {

    final FlacAudioFileReader flacAudioFileReader = new FlacAudioFileReader();
    final File flacTestFile = getFlacTestFile("cymbals.flac");
    InputStream in = null;
    try {
        in = new BufferedInputStream(new FileInputStream(flacTestFile));
        assertTrue("For this test the stream MUST support mark()", in.markSupported());
        final AudioFileFormat fileFormat = flacAudioFileReader.getAudioFileFormat(in);
        assertNotNull(fileFormat);
        final AudioFormat format = fileFormat.getFormat();
        assertEquals(44100f, format.getSampleRate(), 0);
        assertEquals(16, format.getSampleSizeInBits());
        assertEquals(2, format.getChannels());
        assertEquals("FLAC", format.getEncoding().toString());
    } finally {
        if (in != null) {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}