mrglavas    2004/03/11 14:39:00

  Modified:    java/samples/xni ObjectFactory.java
  Log:
  Performance: to read the service provider name from a jar

  we use a BufferedReader and read the first line from the

  file. BufferedReader's default buffer size is 8K chars. Since

  we're only reading one line this is pretty excessive. Reducing

  this size significantly.
  
  Revision  Changes    Path
  1.3       +8 -3      xml-xerces/java/samples/xni/ObjectFactory.java
  
  Index: ObjectFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/xni/ObjectFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ObjectFactory.java        24 Feb 2004 23:41:05 -0000      1.2
  +++ ObjectFactory.java        11 Mar 2004 22:39:00 -0000      1.3
  @@ -53,6 +53,11 @@
   
       /** Set to true for debugging */
       private static final boolean DEBUG = false;
  +    
  +    /**
  +     * Default columns per line.
  +     */
  +    private static final int DEFAULT_LINE_LENGTH = 80;
   
       /** cache the contents of the xerces.properties file.
        *  Until an attempt has been made to read this file, this will
  @@ -429,9 +434,9 @@
           // jkesselm]
           BufferedReader rd;
           try {
  -            rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
  +            rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), 
DEFAULT_LINE_LENGTH);
           } catch (java.io.UnsupportedEncodingException e) {
  -            rd = new BufferedReader(new InputStreamReader(is));
  +            rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
           }
   
           String factoryClassName = null;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to