Ejemplo n.º 1
0
 /*
  * Writes all chars of the given character sequence {@code csq} to the
  * current position of this buffer, and increases the position by the length
  * of the csq.
  * <p/>
  * Calling this method has the same effect as {@code append(csq.toString())}.
  * If the {@code CharSequence} is {@code null} the string "null" will be
  * written to the buffer.
  *
  * @param csq
  *            the {@code CharSequence} to write.
  * @return this buffer.
  * @exception BufferOverflowException
  *                if {@code remaining()} is less than the length of csq.
  * @exception ReadOnlyBufferException
  *                if no changes may be made to the contents of this buffer.
  */
 public virtual CharBuffer append(java.lang.CharSequence csq)
 {
     if (csq != null)
     {
         return(put(csq.toString()));
     }
     return(put("null")); //$NON-NLS-1$
 }
Ejemplo n.º 2
0
 /**
  * Appends the character sequence {@code csq} to the target stream. This
  * method works the same way as {@code PrintStream.print(csq.toString())}.
  * If {@code csq} is {@code null}, then the string "null" is written to the
  * target stream.
  *
  * @param csq
  *            the character sequence appended to the target stream.
  * @return this stream.
  */
 public PrintStream append(java.lang.CharSequence csq)
 {
     if (null == csq)
     {
         print(TOKEN_NULL);
     }
     else
     {
         print(csq.toString());
     }
     return(this);
 }
Ejemplo n.º 3
0
        /*
         * Appends the character sequence {@code csq} to this writer's {@code
         * StringBuffer}. This method works the same way as {@code
         * StringWriter.write(csq.toString())}. If {@code csq} is {@code null}, then
         * the string "null" is written to the target stream.
         *
         * @param csq
         *            the character sequence appended to the target.
         * @return this writer.
         */

        public new StringWriter append(java.lang.CharSequence csq)
        {
            if (null == csq)
            {
                write(TOKEN_NULL);
            }
            else
            {
                write(csq.toString());
            }
            return(this);
        }
Ejemplo n.º 4
0
 /*
  * Appends the character sequence {@code csq} to the target. This method
  * works the same way as {@code Writer.write(csq.toString())}. If {@code
  * csq} is {@code null}, then the string "null" is written to the target
  * stream.
  *
  * @param csq
  *            the character sequence appended to the target.
  * @return this writer.
  * @throws IOException
  *             if this writer is closed or another I/O error occurs.
  */
 public virtual Writer append(java.lang.CharSequence csq)
 {// throws IOException {
     if (null == csq)
     {
         write(TOKEN_NULL);
     }
     else
     {
         write(csq.toString());
     }
     return(this);
 }
Ejemplo n.º 5
0
 /*
  * Writes chars of the given {@code CharSequence} to the current position of
  * this buffer, and increases the position by the number of chars written.
  *
  * @param csq
  *            the {@code CharSequence} to write.
  * @param start
  *            the first char to write, must not be negative and not greater
  *            than {@code csq.length()}.
  * @param end
  *            the last char to write (excluding), must be less than
  *            {@code start} and not greater than {@code csq.length()}.
  * @return this buffer.
  * @exception BufferOverflowException
  *                if {@code remaining()} is less than {@code end - start}.
  * @exception IndexOutOfBoundsException
  *                if either {@code start} or {@code end} is invalid.
  * @exception ReadOnlyBufferException
  *                if no changes may be made to the contents of this buffer.
  */
 public virtual CharBuffer append(java.lang.CharSequence csq, int start, int end)
 {
     if (csq == null)
     {
         //csq = "null";
         return(put("null"));
     }
     java.lang.CharSequence cs = csq.subSequence(start, end);
     if (cs.length() > 0)
     {
         return(put(cs.toString()));
     }
     else
     {
         return(this);
     }
 }
Ejemplo n.º 6
0
        public override CharBuffer get(char[] dest, int off, int len)
        {
            int length = dest.Length;

            if ((off < 0) || (len < 0) || (long)off + (long)len > length)
            {
                throw new java.lang.IndexOutOfBoundsException();
            }
            if (len > remaining())
            {
                throw new BufferUnderflowException();
            }
            int newPosition = positionJ + len;

            sequence.toString().getChars(positionJ, newPosition, dest, off);
            positionJ = newPosition;
            return(this);
        }