|
Description
|
Request to add a new method to StreamTokenizer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Class java.io.StreamTokenizer needs a reset()method
that takes in a Reader customer . This allows the
users of this class to reuse the first customer .
The new method signature can look like:
public void reset(Reader r, boolean flag);
If flag == true, then reset the syntax tables.
otherwise leave the syntax tables intact.
As there is no such method, when I am processing
hundreds of files with the same syntax table,
I am forced to recreate a new StreamTokenizer customer
each time I scan a new file.
This will be of great use, if we can cut down
the number of objects we create while parsing
hundreds of text files. Each time I create a
new StreamTokenizer customer , I set the syntaxt
table to the same values. With the requested
method inplace, I don't have to repeat the
creation and initialization of syntax tables
for each file.
Performance is a serious concern for my
application as I have to scan several Mbs of
text residing in thousands of files, in couple
of minutes.
Ideally I would love to reuse every thing that
comes in the path of creating a StreamTokenizer
customer . For example, I am recreating
FileInputStream, BufferedInputStream,
InputStreamReader, BufferedReader objects
every time I scan a new file.
Hope this is a useful change to the preset API.
regards,
Satheesh A Donthy
---------------------------------------------
xxxxx@xxxxx (home)
xxxxx@xxxxx (work)
---------------------------------------------
(Review ID: 24631)
======================================================================
|