/[classpath]/classpath/gnu/java/io/encode/EncoderEightBitLookup.java
ViewVC logotype

Diff of /classpath/gnu/java/io/encode/EncoderEightBitLookup.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mark, Fri Apr 23 22:36:45 2004 UTC revision 1.8 by jfrijters, Wed Nov 17 14:46:24 2004 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39  package gnu.java.io.encode;  package gnu.java.io.encode;
40    
41  import java.io.OutputStream;  import java.io.OutputStream;
 import java.io.CharConversionException;  
42  import java.io.IOException;  import java.io.IOException;
43    
44  /**  /**
# Line 56  import java.io.IOException; Line 55  import java.io.IOException;
55    */    */
56  public abstract class EncoderEightBitLookup extends Encoder  public abstract class EncoderEightBitLookup extends Encoder
57  {  {
   
58  /*************************************************************************/  /*************************************************************************/
59    
60  /*  /*
61   * Class Variables   * Class Variables
62   */   */
63    
64    private static final byte BAD_CHARACTER = (byte)'?';
65    
66  /**  /**
67    * This is the second generation lookup table that is loaded when the    * This is the second generation lookup table that is loaded when the
# Line 142  bytesInCharArray(char[] buf, int offset, Line 141  bytesInCharArray(char[] buf, int offset,
141    */    */
142  public byte[]  public byte[]
143  convertToBytes(char[] buf, int buf_offset, int len, byte[] bbuf,  convertToBytes(char[] buf, int buf_offset, int len, byte[] bbuf,
144                 int bbuf_offset) throws CharConversionException                 int bbuf_offset)
145  {  {
146    for (int i = 0; i < len; i++)    for (int i = 0; i < len; i++)
147      {      {
# Line 161  convertToBytes(char[] buf, int buf_offse Line 160  convertToBytes(char[] buf, int buf_offse
160              }              }
161            else            else
162              {              {
163                if (bad_char_set)                bbuf[bbuf_offset + i] = BAD_CHARACTER;
                 bbuf[bbuf_offset + i] = encoding_table[bad_char];  
               else  
                 throw new CharConversionException("Encountered unencodable character: " + buf[buf_offset + i]);  
164              }              }
165          }          }
166        else        else

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26