1:
8:
9: package ;
10:
11: public class Input_UnicodeBig extends BytesToUnicode
12: {
13:
14: char partial;
15:
16: int partial_count;
17:
18: public String getName() { return "UnicodeBig"; }
19:
20: public int read (char[] outbuffer, int outpos, int count)
21: {
22: int origcount = count;
23: for (;;)
24: {
25: if (partial_count == 2)
26: {
27: if (count == 0)
28: break;
29: if (partial == 0xFEFF)
30: ;
31:
32: else
33: outbuffer[outpos++] = partial;
34: count--;
35: partial_count = 0;
36: partial = 0;
37: }
38: else if (inpos >= inlength)
39: break;
40: else
41: {
42: int b = inbuffer[inpos++] & 0xFF;
43: partial = (char) (((int) partial << 8) + b);
44: partial_count++;
45: }
46: }
47: return origcount - count;
48: }
49: }