62,614
社区成员
发帖
与我相关
我的任务
分享
public int CreateShareFile(String name ,int size) throws Exception{
private MappedByteBuffer m_mbb = null;
private RandomAccessFile m_raf = null;
private FileChannel m_fc = null;
private int m_isze = 0 ;
if( name == null || size > 100*1024*1024 )
return 0;
m_isze = size;
m_raf = new RandomAccessFile(name, "rw");//读写权限的
m_fc = m_raf.getChannel();
m_mbb = m_fc.map(MapMode.READ_WRITE, 0, size);
return 1;
}
private MappedByteBuffer m_mbb = null;
private RandomAccessFile m_raf = null;
private FileChannel m_fc = null;
private int m_isze = 0 ;
public int CreateShareFile(String name ,int size) throws Exception{
if( name == null || size > 100*1024*1024 )
return 0;
m_isze = size;
m_raf = new RandomAccessFile(name, "rw");
m_fc = m_raf.getChannel();
m_mbb = m_fc.map(MapMode.READ_WRITE, 0, size);
return 1;
}
这个是创建共享文件使用的代码