M
Michael Reppisch
Hi Ng,
i am experiencing a very bad performance when grepping in binary files.
For Text files this seems to be ok.
i'm basically doing the following:
Pattern pattern = Pattern.compile("(viele|ausdruecke|wie|dieser)");
Charset charset = Charset.forName("ISO-8859-15");
CharsetDecoder decoder = charset.newDecoder();
FileInputStream fis = new FileInputStream(f);
FileChannel fc = fis.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, (int)
fc.size());
CharBuffer cb = decoder.decode(bb);
Matcher lm = lpattern.matcher(cb);
while (lm.find()) { ...
I allso tried to use multiline or dotall options with no better performance.
Any Ideas, what i'm doing wrong?
Regards,
Michael
i am experiencing a very bad performance when grepping in binary files.
For Text files this seems to be ok.
i'm basically doing the following:
Pattern pattern = Pattern.compile("(viele|ausdruecke|wie|dieser)");
Charset charset = Charset.forName("ISO-8859-15");
CharsetDecoder decoder = charset.newDecoder();
FileInputStream fis = new FileInputStream(f);
FileChannel fc = fis.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, (int)
fc.size());
CharBuffer cb = decoder.decode(bb);
Matcher lm = lpattern.matcher(cb);
while (lm.find()) { ...
I allso tried to use multiline or dotall options with no better performance.
Any Ideas, what i'm doing wrong?
Regards,
Michael