Beispiel #1
0
 // throws IOException
 /**
  * Reads characters and puts them into the {@code target} character buffer.
  *
  * @param target
  *            the destination character buffer.
  * @return the number of characters put into {@code target} or -1 if the end
  *         of this reader has been reached before a character has been read.
  * @throws IOException
  *             if any I/O error occurs while reading from this reader.
  * @throws NullPointerException
  *             if {@code target} is {@code null}.
  * @throws ReadOnlyBufferException
  *             if {@code target} is read-only.
  */
 public virtual int read(java.nio.CharBuffer target)
 {
     if (null == target) {
         throw new java.lang.NullPointerException();
     }
     int length = target.length();
     char[] buf = new char[length];
     length = java.lang.Math.min(length, read(buf));
     if (length > 0) {
         target.put(buf, 0, length);
     }
     return length;
 }
Beispiel #2
0
 /**
  * Appends the character sequence {@code csq} to the target. This
  * method works the same way as {@code PrintWriter.print(csq.toString())}.
  * If {@code csq} is {@code null}, then the string "null" is written
  * to the target.
  *
  * @param csq
  *            the character sequence appended to the target.
  * @return this writer.
  */
 public new PrintWriter append(java.lang.CharSequence csq)
 {
     if (null == csq) {
         append(new java.lang.StringJ(TOKEN_NULL), 0, TOKEN_NULL.length());
     } else {
         append(csq, 0, csq.length());
     }
     return this;
 }
 internal CharSequenceAdapter(java.lang.CharSequence chseq)
     : base(chseq.length())
 {
     sequence = chseq;
 }