OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [gnu/] [gcj/] [convert/] [Input_8859_1.java] - Blame information for rev 756

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 756 jeremybenn
/* Copyright (C) 1999, 2000  Free Software Foundation
2
 
3
   This file is part of libgcj.
4
 
5
This software is copyrighted work licensed under the terms of the
6
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
7
details.  */
8
 
9
package gnu.gcj.convert;
10
 
11
/**
12
 * Convert ISO-Latin-1 (8859-1) text to Unicode.
13
 * @author Per Bothner <bothner@cygnus.com>
14
 * @date March 1999.
15
 */
16
 
17
public class Input_8859_1 extends BytesToUnicode
18
{
19
  public String getName() { return "8859_1"; }
20
 
21
  public int read (char[] outbuffer, int outpos, int count)
22
  {
23
    int origpos = outpos;
24
    // Make sure fields of this are in registers.
25
    int inpos = this.inpos;
26
    byte[] inbuffer = this.inbuffer;
27
    int inavail = this.inlength - inpos;
28
    int outavail = count;
29
    if (outavail > inavail)
30
      outavail = inavail;
31
    while (--outavail >= 0)
32
      {
33
        outbuffer[outpos++] = (char) (inbuffer[inpos++] & 0xFF);
34
      }
35
    this.inpos = inpos;
36
    return outpos - origpos;
37
  }
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.