help me!!! Thank you!!!! 使用 文件映射 MapperByteBuffer 做对大文件的处理!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 部分代码片段,详见,JAVA_DOC文档import java.nio.MappedByteBuffer;import java.nio.channels.FileChannel;... void countCharacters (String filename) throws IOException { FileInputStream fis = new FileInputStream(filename); FileChannel fc = fis.getChannel(); // Get the file's size and then map it into memory int sz = (int)fc.size(); MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, sz); for (int i=0; i= 0) && (pos <= 25)) { ++countArray[pos]; } } fc.close(); }... 可以试一下JEditorPane或JTextPane这两个组件能包括图像及其他组件,我想能解决你的大容量文件问题。新年新收获! 关于窗体 java将画面中输入的内容,写入到指定的Excel文件的指定的行列中。 EXTJS 高分,求一段算法:字符串转换为循环 用过ASM的朋友请进! rar文件上传到数据库的问题 指针问题,JAVA中的方式可以,C++中同样的方式为什么不行? 可不可以给一个string变量里面的变量名赋值呢? 请大家帮助 JS读取ashx内容 如何确定标点符号是全角还是半角? 有谁使用Textpad的,请进来帮个忙!
详见,JAVA_DOC文档import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
...
void countCharacters (String filename)
throws IOException {
FileInputStream fis = new FileInputStream(filename);
FileChannel fc = fis.getChannel(); // Get the file's size and then map it into memory
int sz = (int)fc.size();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, sz); for (int i=0; i= 0) && (pos <= 25)) {
++countArray[pos];
}
}
fc.close();
}
...
新年新收获!