UnicodeToBytes.java (write(String,int,int,char[])): New overloading, allows greater efficiency.

�
	* gnu/gcj/convert/UnicodeToBytes.java (write(String,int,int,char[])):
	New overloading, allows greater efficiency.
	* gnu/gcj/convert/Output_8859_1.java (write(String,int,int,char[])):
	New overloading (for efficiency - avoids copying).
	* gnu/gcj/convert/Output_UTF8.java:  Fix typo: 0xC0 -> 0c3F.
	* gnu/gcj/convert/Input_UTF8.java:  Fix typos in bit masks.

From-SVN: r26494
This commit is contained in:
Per Bothner
1999-04-16 10:22:02 -07:00
parent c80eb46728
commit 2012fd2db0
3 changed files with 51 additions and 4 deletions
+21 -2
View File
@@ -80,11 +80,30 @@ public abstract class UnicodeToBytes
/** Convert chars to bytes.
* Converted bytes are written to buf, starting at count.
* @param inbuffer sources of characters to convert
* @param inpos index of initial character ininbuffer to convert
* @param inbuffer source of characters to convert
* @param inpos index of initial character in inbuffer to convert
* @param inlength number of characters to convert
* @return number of chars converted
* Also, this.count is increment by the number of bytes converted.
*/
public abstract int write (char[] inbuffer, int inpos, int inlength);
/** Convert chars to bytes.
* Converted bytes are written to buf, starting at count.
* @param str source of characters to convert
* @param inpos index of initial character in str to convert
* @param inlength number of characters to convert
* @param work if non-null, a buffer than can be used
* @return number of chars converted
* Also, this.count is increment by the number of bytes converted.
*/
public int write (String str, int inpos, int inlength, char[] work)
{
if (work == null)
work = new char[inlength];
int srcEnd = inpos + (inlength > work.length ? work.length : inlength);
str.getChars(inpos, srcEnd, work, 0);
return write(work, inpos, inlength);
}
}