src/java.base/share/classes/java/io/BufferedReader.java
changeset 58443 ed0058d06107
parent 58288 48e480e56aad
child 58679 9c3209ff7550
equal deleted inserted replaced
58442:299756f23687 58443:ed0058d06107
   312      * @see        java.io.LineNumberReader#readLine()
   312      * @see        java.io.LineNumberReader#readLine()
   313      *
   313      *
   314      * @throws     IOException  If an I/O error occurs
   314      * @throws     IOException  If an I/O error occurs
   315      */
   315      */
   316     String readLine(boolean ignoreLF, boolean[] term) throws IOException {
   316     String readLine(boolean ignoreLF, boolean[] term) throws IOException {
   317         StringBuffer s = null;
   317         StringBuilder s = null;
   318         int startChar;
   318         int startChar;
   319 
   319 
   320         synchronized (lock) {
   320         synchronized (lock) {
   321             ensureOpen();
   321             ensureOpen();
   322             boolean omitLF = ignoreLF || skipLF;
   322             boolean omitLF = ignoreLF || skipLF;
   370                     }
   370                     }
   371                     return str;
   371                     return str;
   372                 }
   372                 }
   373 
   373 
   374                 if (s == null)
   374                 if (s == null)
   375                     s = new StringBuffer(defaultExpectedLineLength);
   375                     s = new StringBuilder(defaultExpectedLineLength);
   376                 s.append(cb, startChar, i - startChar);
   376                 s.append(cb, startChar, i - startChar);
   377             }
   377             }
   378         }
   378         }
   379     }
   379     }
   380 
   380