...
Code Block | ||
---|---|---|
| ||
private void readIntoDirectBuffer() throws IOException {
ByteBuffer buffer = ByteBuffer.allocateDirect(16*1024);
FileChannel rdr = (new FileInputStream("file")).getChannel();
while(rdr.read(buffer) > 0) {
// do something with the buffer
buffer.clear( );
}
rdr.close();
}
|
Risk Assessment
...