Output_iconv.java 1.1 KB

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