1:
8:
9: package ;
10:
11:
17:
18: public class Output_8859_1 extends UnicodeToBytes
19: {
20: public String getName() { return "8859_1"; }
21:
22:
24: public int write (char[] inbuffer, int inpos, int inlength)
25: {
26: int count = this.count;
27: byte[] buf = this.buf;
28: int avail = buf.length - count;
29: if (inlength > avail)
30: inlength = avail;
31: for (int i = inlength; --i >= 0; )
32: {
33: char c = inbuffer[inpos++];
34: buf[count++] = (byte) ((c > 0xff) ? '?' : c);
35: }
36: this.count = count;
37: return inlength;
38: }
39:
40: public int write (String str, int inpos, int inlength, char[] work)
41: {
42: int count = this.count;
43: byte[] buf = this.buf;
44: int avail = buf.length - count;
45: if (inlength > avail)
46: inlength = avail;
47: for (int i = inlength; --i >= 0; )
48: {
49: char c = str.charAt(inpos++);
50: buf[count++] = (byte) ((c > 0xff) ? '?' : c);
51: }
52: this.count = count;
53: return inlength;
54: }
55: }