public void print(final CharSequence text) throws IOException {
  final int size=text.length();
  int pos=0;
  for (int i=0; i < size; i++) {
    if (text.charAt(i) == '\n') {
      write(text.subSequence(pos,i + 1));
      pos=i + 1;
      atStartOfLine=true;
    }
  }
  write(text.subSequence(pos,size));
}

public void print ( final CharSequence text ) throws IOException { final int size = text . length ( ) ; int pos = 0 ; for ( int i = 0 ; i < size ; i ++ ) { if ( text . charAt ( i ) == '\n' ) { write ( text . subSequence ( pos , i + 1 ) ) ; pos = i + 1 ; atStartOfLine = true ; } } write ( text . subSequence ( pos , size ) ) ; }
print text to the output stream .
