2003-05-10 Michael Koch <konqueror@gmx.de>
+ * java/nio/CharBuffer.java
+ (put): Fixed precondtion check.
+ (toString): Make it work without backing array.
+ (put): Skip one level of method calling.
+
+2003-05-10 Michael Koch <konqueror@gmx.de>
+
* java/security/Identity.java,
java/security/IdentityScope.java,
java/security/Key.java,
if (offset < 0
|| offset >= src.length
|| length < 0
- || length >= (src.length - offset))
+ || length > (src.length - offset))
throw new IndexOutOfBoundsException ();
// Put nothing into this buffer when not enough space left.
*/
public String toString ()
{
- return new String (array (), position (), length ());
+ if (hasArray ())
+ return new String (array (), position (), length ());
+
+ char[] buf = new char [length ()];
+ get (buf);
+ return new String (buf);
}
/**
*/
public final CharBuffer put (String str)
{
- return put (str, 0, str.length ());
+ return put (str.toCharArray (), 0, str.length ());
}
/**