FrameLengthAfterConversion.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:openjdk9 作者:
/**
 * Verifies the frame length after the stream was saved/read to/from file.
 */
private static void testAfterSaveToFile(final AudioFileWriter afw,
                                        final AudioFileFormat.Type type,
                                        AudioInputStream ais) {
    try {
        final File temp = File.createTempFile("sound", ".tmp");
        temp.deleteOnExit();
        afw.write(ais, type, temp);
        ais = AudioSystem.getAudioInputStream(temp);
        final long frameLength = ais.getFrameLength();
        ais.close();
        temp.delete();
        validate(frameLength);
    } catch (IllegalArgumentException | UnsupportedAudioFileException
            | IOException ignored) {
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号