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

05-16 03:36