/* DO NOT EDIT THIS FILE - it is machine generated (JCGO_116) */

#ifdef JCGO_SEPARATED
#define JCGO_116
#include "jcgortl.h"
#include "Main.h"
#endif

#ifdef JCGO_116

#ifdef CHKALL_gnu_java_nio_charset_UTF_116Encoder
#include "jcgobchk.h"
#endif

JCGO_NOSEP_STATIC gnu_java_nio_charset_UTF_16Encoder CFASTCALL
gnu_java_nio_charset_UTF_16Encoder__this__L7qsf6IZ( gnu_java_nio_charset_UTF_16Encoder
 This, java_nio_charset_Charset cs, jint byteOrder, jboolean useByteOrderMark
 )
{
 {
  (java_nio_charset_CharsetEncoder__this__L7qsf6FFBA((java_nio_charset_CharsetEncoder)This,
   cs, byteOrder == gnu_java_nio_charset_UTF_16Encoder__BIG_ENDIAN0?
   (jbyteArr)jcgo_arrayClone((jObject)JCGO_OBJREF_OF(jcgo_array2_UTF16Enc)) :
   (jbyteArr)jcgo_arrayClone((jObject)JCGO_OBJREF_OF(jcgo_array3_UTF16Enc)),
   (jfloat)2.0, useByteOrderMark? (jfloat)4.0 : (jfloat)2.0));
  JCGO_FIELD_NZACCESS(This, byteOrder)= (byteOrder == gnu_java_nio_charset_UTF_16Encoder__BIG_ENDIAN0)?
   JCGO_CLINIT_VARACC(java_nio_ByteOrder__class, java_nio_ByteOrder__BIG_ENDIAN0) :
   JCGO_CLINIT_VARACC(java_nio_ByteOrder__class, java_nio_ByteOrder__LITTLE_ENDIAN0);
  JCGO_FIELD_NZACCESS(This, useByteOrderMark)= (jboolean)useByteOrderMark;
  JCGO_FIELD_NZACCESS(This, needsByteOrderMark)= (jboolean)useByteOrderMark;
 }
 return This;
}

JCGO_NOSEP_FRWINL gnu_java_nio_charset_UTF_16Encoder CFASTCALL
gnu_java_nio_charset_UTF_16Encoder__new__L7qsf6IZ( java_nio_charset_Charset
 cs, jint byteOrder, jboolean useByteOrderMark )
{
 return gnu_java_nio_charset_UTF_16Encoder__this__L7qsf6IZ(
  (gnu_java_nio_charset_UTF_16Encoder)jcgo_newObject((jvtable)&gnu_java_nio_charset_UTF_16Encoder_methods),
  cs, byteOrder, useByteOrderMark);
}

JCGO_NOSEP_STATIC java_nio_charset_CoderResult CFASTCALL
gnu_java_nio_charset_UTF_16Encoder__encodeLoop__L3367bL9oaia( gnu_java_nio_charset_UTF_16Encoder
 This, java_nio_CharBuffer in, java_nio_ByteBuffer out )
{
 {
  java_nio_ByteOrder originalBO;
  JCGO_TRY_VOLATILE jint inPos;
  originalBO= (JCGO_CALL_FINALF(out) java_nio_ByteBuffer__order__(
   out));
  (java_nio_ByteBuffer__order__L14v1d(
   out, JCGO_FIELD_NZACCESS(This, byteOrder)));
  if (JCGO_FIELD_NZACCESS(This, needsByteOrderMark))
  {
   if ((java_nio_Buffer__remaining__(
    (java_nio_Buffer)out)) < (jint)2)
   {
    (java_nio_ByteBuffer__order__L14v1d(
     out, originalBO));
    return JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
     java_nio_charset_CoderResult__OVERFLOW);
   }
   (java_nio_ByteBufferImpl__putChar__C(
    (java_nio_ByteBufferImpl)out, gnu_java_nio_charset_UTF_16Encoder__BYTE_ORDER_MARK));
   JCGO_FIELD_NZACCESS(This, needsByteOrderMark)= (jboolean)jfalse;
  }
  inPos= (JCGO_CALL_FINALF(in) java_nio_Buffer__position__(
   (java_nio_Buffer)in));
  {
   JCGO_TRY_BLOCK
   {
    while ((java_nio_Buffer__hasRemaining__(
     (java_nio_Buffer)in)))
    {
     jchar c;
     c= (java_nio_CharBufferImpl__get__(
      (java_nio_CharBufferImpl)in));
     if ((jint)55296L <= (jint)c && (jint)c <= (jint)57343L)
     {
      jchar d;
      if ((jint)c > (jint)56319L)
      {
       {
        java_nio_charset_CoderResult jcgo_retval= (java_nio_charset_CoderResult__malformedForLength__I(
         (jint)1));
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      if ((java_nio_Buffer__remaining__(
       (java_nio_Buffer)in)) < (jint)1)
      {
       {
        java_nio_charset_CoderResult jcgo_retval= JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
         java_nio_charset_CoderResult__UNDERFLOW);
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      d= (java_nio_CharBufferImpl__get__(
       (java_nio_CharBufferImpl)in));
      if ((jint)d < (jint)56320L || (jint)d > (jint)57343L)
      {
       {
        java_nio_charset_CoderResult jcgo_retval= (java_nio_charset_CoderResult__malformedForLength__I(
         (jint)1));
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      (java_nio_ByteBufferImpl__putChar__C(
       (java_nio_ByteBufferImpl)out, c));
      (java_nio_ByteBufferImpl__putChar__C(
       (java_nio_ByteBufferImpl)out, d));
      inPos+= (jint)2;
     }
     else
     {
      if ((java_nio_Buffer__remaining__(
       (java_nio_Buffer)out)) < (jint)2)
      {
       (java_nio_ByteBuffer__order__L14v1d(
        out, originalBO));
       {
        java_nio_charset_CoderResult jcgo_retval= JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
         java_nio_charset_CoderResult__OVERFLOW);
#ifndef JCGO_SEHTRY
        jcgo_tryLeave();
        {
         (java_nio_Buffer__position__I(
          (java_nio_Buffer)in, inPos));
        }
#endif
        return jcgo_retval;
       }
      }
      (java_nio_ByteBufferImpl__putChar__C(
       (java_nio_ByteBufferImpl)out, c));
      inPos++;
     }
    }
    (java_nio_ByteBuffer__order__L14v1d(
     out, originalBO));
    {
     java_nio_charset_CoderResult jcgo_retval= JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class,
      java_nio_charset_CoderResult__UNDERFLOW);
#ifndef JCGO_SEHTRY
     jcgo_tryLeave();
     {
      (java_nio_Buffer__position__I(
       (java_nio_Buffer)in, inPos));
     }
#endif
     return jcgo_retval;
    }
   }
   JCGO_TRY_LEAVE
   {
    (java_nio_Buffer__position__I(
     (java_nio_Buffer)in, inPos));
   }
   JCGO_TRY_FINALLYEND
  }
 }
 return jnull;
}

JCGO_NOSEP_INLINE void CFASTCALL
gnu_java_nio_charset_UTF_16Encoder__implReset__( gnu_java_nio_charset_UTF_16Encoder
 This )
{
 {
  JCGO_FIELD_NZACCESS(This, needsByteOrderMark)= (jboolean)JCGO_FIELD_NZACCESS(This,
   useByteOrderMark);
 }
}

JCGO_NOSEP_DATA CONST struct gnu_java_nio_charset_UTF_16Encoder_methods_s
 gnu_java_nio_charset_UTF_16Encoder_methods=
{
 JCGO_CLASSREF_OF(gnu_java_nio_charset_UTF_16Encoder__class),
 JCGO_GCJDESCR_INIT(gnu_java_nio_charset_UTF_16Encoder_s, byteOrder)
 OBJT_gnu_java_nio_charset_UTF_16Encoder,
 (JCGO_OBJSIZE_T)sizeof(struct gnu_java_nio_charset_UTF_16Encoder_s),
 NULL,
 JCGO_CLINIT_INIT(0)
 0,
 java_lang_Object__equals__Lo,
 java_lang_Object__hashCode__,
 java_lang_Object__toString__,
 java_lang_Object__finalize__,
 gnu_java_nio_charset_UTF_16Encoder__encodeLoop__L3367bL9oaia,
 gnu_java_nio_charset_UTF_16Encoder__implReset__
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct gnu_java_nio_charset_UTF_16Encoder_class_s
 gnu_java_nio_charset_UTF_16Encoder__class JCGO_THRD_ATTRNONGC=
{
 {
  &java_lang_Class_methods,
  JCGO_MON_INIT
  JCGO_OBJREF_OF(*(java_lang_Object)&gnu_java_nio_charset_UTF_16Encoder_methods),
  JCGO_STRREF_OF(jcgo_string1_UTF16Enc),
  JCGO_CLASSREF_OF(java_nio_charset_CharsetEncoder__class),
  ((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
  0x10
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype33_Object jcgo_array2_UTF16Enc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 2,
 {
  (jbyte)(jint)255, (jbyte)(jint)253
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype33_Object jcgo_array3_UTF16Enc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 2,
 {
  (jbyte)(jint)253, (jbyte)(jint)255
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype87_GmCnnctn jcgo_array4_UTF16Enc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 34,
 {
  (jbyte)(jchar)103/*'g'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)117/*'u'*/,
   (jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)106/*'j'*/, (jbyte)(jchar)97/*'a'*/,
   (jbyte)(jchar)118/*'v'*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)46/*'.'*/,
   (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)111/*'o'*/,
   (jbyte)(jchar)46/*'.'*/, (jbyte)(jchar)99/*'c'*/, (jbyte)(jchar)104/*'h'*/,
   (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)114/*'r'*/, (jbyte)(jchar)115/*'s'*/,
   (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)46/*'.'*/,
   (jbyte)(jchar)85/*'U'*/, (jbyte)(jchar)84/*'T'*/, (jbyte)(jchar)70/*'F'*/,
   (jbyte)(jchar)95/*'_'*/, (jbyte)(jchar)49/*'1'*/, (jbyte)(jchar)54/*'6'*/,
   (jbyte)(jchar)69/*'E'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)99/*'c'*/,
   (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)100/*'d'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)114/*'r'*/
 }
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_UTF16Enc
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array4_UTF16Enc),
 0, 34, (jint)0x82515db7L
};

#ifdef CHKALL_gnu_java_nio_charset_UTF_116Encoder
#include "jcgochke.h"
#endif

#endif
