码迷,mamicode.com
首页 > 移动开发 > 详细

java中使用MappedByteBuffer将 File类转ByteBuffer

时间:2019-08-29 18:45:02      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:tps   open   bsp   buffer   col   www   mapped   etc   get   

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

java中使用MappedByteBuffer将 File类转ByteBuffer

标签:tps   open   bsp   buffer   col   www   mapped   etc   get   

原文地址:https://www.cnblogs.com/passedbylove/p/11430989.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!