public String readText() throws IOException {
  closeBinaryStream(true);
  int size=0;
  int sep;
  int newSize;
  int numBuffered;
  int consumed=0;
  while (!isStreamEnded()) {
    sep=findSep(0);
    newSize=size + sep;
    if (newSize > textBuffer.length) {
      textBuffer=Arrays.copyOf(textBuffer,Math.max(textBuffer.length << 1,newSize));
    }
    if (sep > 0) {
      System.arraycopy(buffer,0,textBuffer,size,sep);
    }
    size=newSize;
    numBuffered=buffered;
    if (sep == numBuffered) {
      use(numBuffered);
      consumed+=numBuffered;
    }
 else {
      use(sep + 1);
      consumed+=sep + 1;
      break;
    }
    reload();
  }
  if (consumed == 0)   return null;
  if (size == 0)   return EMPTY_TEXT;
  return new String(textBuffer,0,size,textEncoding);
}

public String readText ( ) throws IOException { closeBinaryStream ( true ) ; int size = 0 ; int sep ; int newSize ; int numBuffered ; int consumed = 0 ; while ( ! isStreamEnded ( ) ) { sep = findSep ( 0 ) ; newSize = size + sep ; if ( newSize > textBuffer . length ) { textBuffer = Arrays . copyOf ( textBuffer , Math . max ( textBuffer . length << 1 , newSize ) ) ; } if ( sep > 0 ) { System . arraycopy ( buffer , 0 , textBuffer , size , sep ) ; } size = newSize ; numBuffered = buffered ; if ( sep == numBuffered ) { use ( numBuffered ) ; consumed += numBuffered ; } else { use ( sep + 1 ) ; consumed += sep + 1 ; break ; } reload ( ) ; } if ( consumed == 0 ) return null ; if ( size == 0 ) return EMPTY_TEXT ; return new String ( textBuffer , 0 , size , textEncoding ) ; }
read a line of text and return it .
