// Get a FileChannel from the given file.
FileChannel fc = new FileInputStream(fileName).getChannel();
// Map the file's content
ByteBuffer buf = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
// Decode ByteBuffer into CharBuffer
CharBuffer cbuf =
Charset.forName("ISO-8859-1").newDecoder().decode(buf);
Matcher m = pattern.matcher(cbuf);
while (m.find()) {
System.out.println(m.group(0));
}