public static WavFile openWavFile(File file) throws IOException, WavFileException
    {
        FileChannel channel = new FileInputStream(file).getChannel();

        MappedByteBuffer mappedByteBuffer = channel
                .map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
        return openWavFile(mappedByteBuffer);
    }
public static WavFile openWavFile(ByteBuffer buffer) throws IOException, WavFileException
{
。。。。
}

 来源:https://www.baeldung.com/java-mapped-byte-buffer

posted on 2019-08-29 17:29  你不知道的浪漫  阅读(860)  评论(0编辑  收藏  举报