mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-20 16:39:50 +08:00
ee9dd3721b
From-SVN: r26263
33 lines
845 B
Java
33 lines
845 B
Java
/* Copyright (C) 1999 Cygnus Solutions
|
|
|
|
This file is part of libgcj.
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
details. */
|
|
|
|
package gnu.gcj.convert;
|
|
|
|
public class Input_8859_1 extends BytesToUnicode
|
|
{
|
|
public String getName() { return "8859_1"; }
|
|
|
|
public int read (char[] outbuffer, int outpos, int outlength)
|
|
{
|
|
int origpos = outpos;
|
|
// Make sure fields of this are in registers.
|
|
int inpos = this.inpos;
|
|
byte[] inbuffer = this.inbuffer;
|
|
int inavail = this.inlength - inpos;
|
|
int outavail = outlength - outpos;
|
|
if (outavail > inavail)
|
|
outavail = inavail;
|
|
while (--outavail >= 0)
|
|
{
|
|
outbuffer[outpos++] = (char) (inbuffer[inpos++] & 0xFF);
|
|
}
|
|
this.inpos = inpos;
|
|
return outpos - origpos;
|
|
}
|
|
}
|