标签:class 随机 ann channel txt 设置 mac new code
RandomAccessFile可以设置文件锁
RandomAccessFile input=new RandomAccessFile("test.txt","rw")//得到一个随机流 FileChannel channel1=input.getChannel()//得到文件通道 FileLock lock=channel1.tryLock()//锁 lock.release()//释放锁
标签:class 随机 ann channel txt 设置 mac new code
原文地址:http://www.cnblogs.com/vhyc/p/6041054.html