diff options
| author | Per Bothner <bothner@gcc.gnu.org> | 1999-04-16 10:22:02 -0700 |
|---|---|---|
| committer | Per Bothner <bothner@gcc.gnu.org> | 1999-04-16 10:22:02 -0700 |
| commit | 2012fd2db0eae2abfc09c43fc58ebd605c1a1da9 (patch) | |
| tree | 2a12dcf74335a9116c0605d4bd6fa63a1a66e2fe /libjava/gnu/gcj/convert/Output_8859_1.java | |
| parent | c80eb46728381731106e0f54725cd1b8285c3a15 (diff) | |
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
Diffstat (limited to 'libjava/gnu/gcj/convert/Output_8859_1.java')
| -rw-r--r-- | libjava/gnu/gcj/convert/Output_8859_1.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libjava/gnu/gcj/convert/Output_8859_1.java b/libjava/gnu/gcj/convert/Output_8859_1.java index ef6e211f9f8..8dd9f43d717 100644 --- a/libjava/gnu/gcj/convert/Output_8859_1.java +++ b/libjava/gnu/gcj/convert/Output_8859_1.java @@ -8,6 +8,13 @@ details. */ package gnu.gcj.convert; +/** + * Convert Unicode ISO-Latin-1 (8851-1) text. + * The high-order byte of each character is truncated. + * @author Per Bothner <bothner@cygnus.com> + * @date Match 1999. + */ + public class Output_8859_1 extends UnicodeToBytes { public String getName() { return "8859_1"; } @@ -28,4 +35,19 @@ public class Output_8859_1 extends UnicodeToBytes this.count = count; return inlength; } + + public int write (String str, int inpos, int inlength, char[] work) + { + int count = this.count; + byte[] buf = this.buf; + int avail = buf.length - count; + if (inlength > avail) + inlength = avail; + for (int i = inlength; --i >= 0; ) + { + buf[count++] = (byte) str.charAt(inpos++); + } + this.count = count; + return inlength; + } } |
