1 /* Copyright (C) 2004 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 package gnu
.gcj
.convert
;
11 public class Input_UnicodeBig
extends BytesToUnicode
13 /** 0, 8, or 16 bits of a partially constructed character. */
15 /** How many bytes of partial are valid. */
18 public String
getName() { return "UnicodeBig"; }
20 public int read (char[] outbuffer
, int outpos
, int count
)
22 int origcount
= count
;
25 if (partial_count
== 2)
29 if (partial
== 0xFEFF)
30 ; // drop byte order mark
31 // else if (partial >= 0xFFFe) ERROR;
33 outbuffer
[outpos
++] = partial
;
38 else if (inpos
>= inlength
)
42 int b
= inbuffer
[inpos
++] & 0xFF;
43 partial
= (char) (((int) partial
<< 8) + b
);
47 return origcount
- count
;