...
Code Block | ||
---|---|---|
| ||
void exampleFuntionreadData() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream("file"))); // Read from the file } |
...
Code Block | ||
---|---|---|
| ||
void exampleFuntionreadData() throws IOException{ ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024); try(FileChannel rdr = (new FileInputStream("file")).getChannel()){ while (rdr.read(buffer) > 0) { // Do something with the buffer buffer.clear(); } } catch (Exception e) { // Handle error } } |
...