AudioSystem.java 文件源码

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

项目:openjdk-jdk10 作者:
/**
 * Obtains the file types that the system can write from the audio input
 * stream specified.
 *
 * @param  stream the audio input stream for which audio file type support
 *         is queried
 * @return array of file types. If no file types are supported, an array of
 *         length 0 is returned.
 * @throws NullPointerException if {@code stream} is {@code null}
 */
public static AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) {
    Objects.requireNonNull(stream);
    List<AudioFileWriter> providers = getAudioFileWriters();
    Set<AudioFileFormat.Type> returnTypesSet = new HashSet<>();

    for(int i=0; i < providers.size(); i++) {
        AudioFileWriter writer = providers.get(i);
        AudioFileFormat.Type[] fileTypes = writer.getAudioFileTypes(stream);
        for(int j=0; j < fileTypes.length; j++) {
            returnTypesSet.add(fileTypes[j]);
        }
    }
    AudioFileFormat.Type returnTypes[] =
        returnTypesSet.toArray(new AudioFileFormat.Type[0]);
    return returnTypes;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号