Source for gnu.gcj.convert.Output_iconv

   1: // Output_iconv.java -- Java side of iconv() writer.
   2: 
   3: /* Copyright (C) 2000, 2001  Free Software Foundation
   4: 
   5:    This file is part of libgcj.
   6: 
   7: This software is copyrighted work licensed under the terms of the
   8: Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
   9: details.  */
  10: 
  11: package gnu.gcj.convert;
  12: import gnu.gcj.RawData;
  13: import java.io.UnsupportedEncodingException;
  14: 
  15: /**
  16:  * Convert Unicode to bytes in some iconv-supported encoding.
  17:  * @author Tom Tromey <tromey@redhat.com>
  18:  * @date January 30, 2000
  19:  */
  20: 
  21: public class Output_iconv extends UnicodeToBytes
  22: {
  23:   public Output_iconv (String encoding) throws UnsupportedEncodingException
  24:   {
  25:     this.encoding = encoding;
  26:     this.handle = null;
  27:     init (encoding);
  28:   }
  29: 
  30:   public String getName() { return encoding; }
  31: 
  32:   public native void finalize ();
  33:   private native void init (String encoding)
  34:     throws UnsupportedEncodingException;
  35:   public native int write (char[] inbuffer, int inpos, int count);
  36:   public native void done ();
  37: 
  38:   // The encoding we're using.
  39:   private String encoding;
  40: 
  41:   // The iconv handle.
  42:   private RawData handle;
  43: }