package org.jboss.media.util;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
public class FileChannelUtils
{
public MappedByteBuffer getMappedByte(String fileName) throws IOException
{
FileChannel fileChannel = new FileInputStream(fileName).getChannel();
int fileSize = (int) fileChannel.size();
MappedByteBuffer mappedfile =
fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileSize);
mappedfile.load();
return mappedfile;
}
}