1 /* Copyright (C) 2000 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
;
12 * Convert ASCII text to Unicode.
16 public class Input_ASCII
extends BytesToUnicode
18 public String
getName() { return "ASCII"; }
20 public int read (char[] outbuffer
, int outpos
, int count
)
23 // Make sure fields of this are in registers.
24 int inpos
= this.inpos
;
25 byte[] inbuffer
= this.inbuffer
;
26 int inavail
= this.inlength
- inpos
;
28 if (outavail
> inavail
)
30 while (--outavail
>= 0)
32 outbuffer
[outpos
++] = (char) (inbuffer
[inpos
++] & 0x7f);
35 return outpos
- origpos
;