Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Although StrBuilder supports CharSequence (and thus StringBuilder), it does so by converting it to a String temporarily. This is a bit wasteful.
It would be useful to support StringBuilder directly, as that provides the getChars() method which does a direct copy of the buffer contents.
This would involve adding two new methods:
getChars(StringBuilder)
getChars(StringBuilder, int, int)which can be a direct copy of the StringBuffer methods.
Sadly there is no accessible interface or super-class that would allow the methods to share code.
Although StrBuilder supports CharSequence (and thus StringBuilder), it does so by converting it to a String temporarily. This is a bit wasteful. It would be useful to support StringBuilder directly, as that provides the getChars() method which does a direct copy of the buffer contents. This would involve adding two new methods: getChars(StringBuilder) getChars(StringBuilder, int, int) which can be a direct copy of the StringBuffer methods. Sadly there is no accessible interface or super-class that would allow the methods to share code.