/* 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_java_nio_charset_CharsetEncoder
#include "jcgobchk.h"
#endif

JCGO_NOSEP_INLINE void CFASTCALL
java_nio_charset_CharsetEncoder__void( java_nio_charset_CharsetEncoder
 This )
{
 JCGO_FIELD_NZACCESS(This, state)= java_nio_charset_CharsetEncoder__STATE_RESET;
 JCGO_FIELD_NZACCESS(This, malformedInputAction)= JCGO_CLINIT_VARACC(java_nio_charset_CodingErrorAction__class,
  java_nio_charset_CodingErrorAction__REPORT);
 JCGO_FIELD_NZACCESS(This, unmappableCharacterAction)= JCGO_CLINIT_VARACC(java_nio_charset_CodingErrorAction__class,
  java_nio_charset_CodingErrorAction__REPORT);
}

JCGO_NOSEP_STATIC java_nio_charset_CharsetEncoder CFASTCALL
java_nio_charset_CharsetEncoder__this__L7qsf6FFBA( java_nio_charset_CharsetEncoder
 This, java_nio_charset_Charset cs, jbyteArr replacement, jfloat averageBytesPerChar,
 jfloat maxBytesPerChar )
{
 {
  ;
  java_nio_charset_CharsetEncoder__void(This);
  if (JCGO_FP_EQUF(averageBytesPerChar, (jfloat)0))
  {
   averageBytesPerChar= (jfloat)(jint)1;
  }
  if (JCGO_FP_EQUF(maxBytesPerChar, (jfloat)0))
  {
   maxBytesPerChar= (jfloat)(jint)1;
  }
  if (JCGO_FP_LQF(averageBytesPerChar, (jfloat)0.0))
  {
   JCGO_THROW_EXC((java_lang_IllegalArgumentException__new__Ls(
    JCGO_STRREF_OF(jcgo_string3_ChrstEnc))));
  }
  if (JCGO_FP_LQF(maxBytesPerChar, (jfloat)0.0))
  {
   JCGO_THROW_EXC((java_lang_IllegalArgumentException__new__Ls(
    JCGO_STRREF_OF(jcgo_string4_ChrstEnc))));
  }
  (void)cs;
  (void)averageBytesPerChar;
  JCGO_FIELD_NZACCESS(This, maxBytesPerChar)= maxBytesPerChar;
  JCGO_FIELD_NZACCESS(This, replacement)= replacement;
  (java_nio_charset_CharsetEncoder__implReplaceWith__BA(
   This, replacement));
 }
 return This;
}

JCGO_NOSEP_FRWINL void CFASTCALL
java_nio_charset_CharsetEncoder__implReplaceWith__BA( java_nio_charset_CharsetEncoder
 This, jbyteArr newReplacement )
{
 {
 }
}

JCGO_NOSEP_INLINE jfloat CFASTCALL
java_nio_charset_CharsetEncoder__maxBytesPerChar__( java_nio_charset_CharsetEncoder
 This )
{
 {
  return JCGO_FIELD_NZACCESS(This, maxBytesPerChar);
 }
}

JCGO_NOSEP_INLINE java_nio_charset_CoderResult CFASTCALL
java_nio_charset_CharsetEncoder__encode__L3367bL9oaiaZ( java_nio_charset_CharsetEncoder
 This, java_nio_CharBuffer in, java_nio_ByteBuffer out, jboolean endOfInput
 )
{
 {
  jint newState;
  newState= endOfInput? java_nio_charset_CharsetEncoder__STATE_END :
   java_nio_charset_CharsetEncoder__STATE_CODING;
  if (JCGO_FIELD_NZACCESS(This, state) != java_nio_charset_CharsetEncoder__STATE_RESET &&
   JCGO_FIELD_NZACCESS(This, state) != java_nio_charset_CharsetEncoder__STATE_CODING &&
   !(endOfInput && JCGO_FIELD_NZACCESS(This, state) == java_nio_charset_CharsetEncoder__STATE_END))
  {
   JCGO_THROW_EXC(java_lang_IllegalStateException__new__());
  }
  JCGO_FIELD_NZACCESS(This, state)= newState;
  for (;;)
  {
   java_nio_charset_CoderResult JCGO_TRY_VOLATILE cr;
   java_nio_charset_CodingErrorAction action;
   jint jcgo_rcvrI1;
   {
    JCGO_TRY_BLOCK
    {
     cr= (JCGO_CALL_NZVFUNC(This)->encodeLoop__L3367bL9oaia(
      This, in, out));
    }
    JCGO_TRY_LEAVE
    JCGO_TRY_CATCHES(1)
    JCGO_TRY_CATCH(OBJT_java_lang_RuntimeException, MAXT_java_lang_RuntimeException)
    {
     java_lang_RuntimeException e;
     e= (java_lang_RuntimeException)JCGO_TRY_THROWABLE(0);
     JCGO_THROW_EXC((java_nio_charset_CoderMalfunctionError__new__L6tfiz(
      (java_lang_Exception)e)));
    }
    JCGO_TRY_RETHROW(1)
   }
   if ((JCGO_CALL_FINALF(cr) java_nio_charset_CoderResult__isOverflow__(
    cr)))
   {
    return cr;
   }
   if ((java_nio_charset_CoderResult__isUnderflow__(
    cr)))
   {
    if (endOfInput && (JCGO_CALL_FINALF(in) java_nio_Buffer__hasRemaining__(
     (java_nio_Buffer)in)))
    {
     cr= (java_nio_charset_CoderResult__malformedForLength__I(
      (JCGO_CALL_FINALF(in) java_nio_Buffer__remaining__(
      (java_nio_Buffer)in))));
    }
    else
    {
     return cr;
    }
   }
   action= (JCGO_CALL_FINALF(cr) java_nio_charset_CoderResult__isMalformed__(
    cr))? JCGO_FIELD_NZACCESS(This, malformedInputAction) : JCGO_FIELD_NZACCESS(This,
    unmappableCharacterAction);
   if (action == JCGO_CLINIT_VARACC(java_nio_charset_CodingErrorAction__class,
    java_nio_charset_CodingErrorAction__REPORT))
   {
    return cr;
   }
   if (action == java_nio_charset_CodingErrorAction__REPLACE)
   {
    jint jcgo_rcvrI1;
    if ((jcgo_rcvrI1= (JCGO_CALL_FINALF(out) java_nio_Buffer__remaining__(
     (java_nio_Buffer)out)), jcgo_rcvrI1 < JCGO_ARRAY_LENGTH(JCGO_FIELD_NZACCESS(This,
     replacement))))
    {
     return java_nio_charset_CoderResult__OVERFLOW;
    }
    (java_nio_ByteBuffer__put__BA(
     out, JCGO_FIELD_NZACCESS(This, replacement)));
   }
   (JCGO_CALL_FINALF(in) java_nio_Buffer__position__I(
    (java_nio_Buffer)in, (jcgo_rcvrI1= (JCGO_CALL_FINALF(in) java_nio_Buffer__position__(
    (java_nio_Buffer)in)), jcgo_rcvrI1 + (java_nio_charset_CoderResult__length__(
    cr)))));
  }
 }
 return jnull;
}

JCGO_NOSEP_INLINE java_nio_charset_CoderResult CFASTCALL
java_nio_charset_CharsetEncoder__implFlush__L9oaia( java_nio_charset_CharsetEncoder
 This, java_nio_ByteBuffer out )
{
 {
  return JCGO_CLINIT_VARACC(java_nio_charset_CoderResult__class, java_nio_charset_CoderResult__UNDERFLOW);
 }
}

JCGO_NOSEP_INLINE java_nio_charset_CoderResult CFASTCALL
java_nio_charset_CharsetEncoder__flush__L9oaia( java_nio_charset_CharsetEncoder
 This, java_nio_ByteBuffer out )
{
 {
  if (JCGO_FIELD_NZACCESS(This, state) != java_nio_charset_CharsetEncoder__STATE_RESET &&
   JCGO_FIELD_NZACCESS(This, state) != java_nio_charset_CharsetEncoder__STATE_END)
  {
   JCGO_THROW_EXC(java_lang_IllegalStateException__new__());
  }
  JCGO_FIELD_NZACCESS(This, state)= java_nio_charset_CharsetEncoder__STATE_FLUSHED;
  return (java_nio_charset_CharsetEncoder__implFlush__L9oaia(
   This, out));
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
java_nio_charset_CharsetEncoder__implOnMalformedInput__L6zetg( java_nio_charset_CharsetEncoder
 This, java_nio_charset_CodingErrorAction newAction )
{
 {
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
java_nio_charset_CharsetEncoder__implOnUnmappableCharacter__L6zetg(
 java_nio_charset_CharsetEncoder This, java_nio_charset_CodingErrorAction
 newAction )
{
 {
 }
}

JCGO_NOSEP_INLINE void CFASTCALL
java_nio_charset_CharsetEncoder__implReset__( java_nio_charset_CharsetEncoder
 This )
{
 {
 }
}

JCGO_NOSEP_INLINE java_nio_charset_CharsetEncoder CFASTCALL
java_nio_charset_CharsetEncoder__this__L7qsf6FF( java_nio_charset_CharsetEncoder
 This, java_nio_charset_Charset cs, jfloat averageBytesPerChar, jfloat
 maxBytesPerChar )
{
 {
  (java_nio_charset_CharsetEncoder__this__L7qsf6FFBA((java_nio_charset_CharsetEncoder)This,
   cs, java_nio_charset_CharsetEncoder__DEFAULT_REPLACEMENT, averageBytesPerChar,
   maxBytesPerChar));
 }
 return This;
}

JCGO_NOSEP_STATIC java_nio_ByteBuffer CFASTCALL
java_nio_charset_CharsetEncoder__encode__L3367b( java_nio_charset_CharsetEncoder
 This, java_nio_CharBuffer in )
{
 {
  java_nio_ByteBuffer out;
  java_nio_charset_CoderResult cr;
  jint remaining;
  jint n;
  if (JCGO_FIELD_NZACCESS(This, state) != java_nio_charset_CharsetEncoder__STATE_RESET)
  {
   JCGO_THROW_EXC(java_lang_IllegalStateException__new__());
  }
  remaining= (JCGO_CALL_FINALF(in) java_nio_Buffer__remaining__(
   (java_nio_Buffer)in));
  n= JCGO_JFLOAT_TOJINT(((jfloat)remaining * (java_nio_charset_CharsetEncoder__maxBytesPerChar__(
   This))));
  out= (java_nio_ByteBuffer__allocate__I(
   n));
  if (remaining == 0)
  {
   JCGO_FIELD_NZACCESS(This, state)= java_nio_charset_CharsetEncoder__STATE_FLUSHED;
   return out;
  }
  cr= (java_nio_charset_CharsetEncoder__encode__L3367bL9oaiaZ(
   This, in, out, (jboolean)jtrue));
  if ((java_nio_charset_CoderResult__isError__(
   cr)))
  {
   (java_nio_charset_CoderResult__throwException__(
    cr));
  }
  cr= (java_nio_charset_CharsetEncoder__flush__L9oaia(
   This, out));
  if ((JCGO_CALL_FINALF(cr) java_nio_charset_CoderResult__isError__(
   cr)))
  {
   (java_nio_charset_CoderResult__throwException__(
    cr));
  }
  (java_nio_Buffer__flip__(
   (java_nio_Buffer)out));
  if ((java_nio_Buffer__remaining__(
   (java_nio_Buffer)out)) < n - JCGO_SHR_F(n, (jint)2))
  {
   jbyteArr resized;
   resized= (jbyteArr)jcgo_newArray(JCGO_CORECLASS_FOR(OBJT_jbyte),
    0, (java_nio_Buffer__remaining__(
    (java_nio_Buffer)out)));
   (java_nio_ByteBuffer__get__BA(
    out, resized));
   return (java_nio_ByteBuffer__wrap__BA(
    resized));
  }
  return out;
 }
}

JCGO_NOSEP_STATIC java_nio_charset_CharsetEncoder CFASTCALL
java_nio_charset_CharsetEncoder__onMalformedInput__L6zetg( java_nio_charset_CharsetEncoder
 This, java_nio_charset_CodingErrorAction newAction )
{
 {
  if (newAction == jnull)
  {
   JCGO_THROW_EXC((java_lang_IllegalArgumentException__new__Ls(
    JCGO_STRREF_OF(jcgo_string5_ChrstEnc))));
  }
  JCGO_FIELD_NZACCESS(This, malformedInputAction)= newAction;
  (java_nio_charset_CharsetEncoder__implOnMalformedInput__L6zetg(
   This, newAction));
  return This;
 }
}

JCGO_NOSEP_STATIC java_nio_charset_CharsetEncoder CFASTCALL
java_nio_charset_CharsetEncoder__onUnmappableCharacter__L6zetg( java_nio_charset_CharsetEncoder
 This, java_nio_charset_CodingErrorAction newAction )
{
 {
  if (newAction == jnull)
  {
   JCGO_THROW_EXC((java_lang_IllegalArgumentException__new__Ls(
    JCGO_STRREF_OF(jcgo_string5_ChrstEnc))));
  }
  JCGO_FIELD_NZACCESS(This, unmappableCharacterAction)= newAction;
  (java_nio_charset_CharsetEncoder__implOnUnmappableCharacter__L6zetg(
   This, newAction));
  return This;
 }
}

JCGO_NOSEP_FRWINL java_nio_charset_CharsetEncoder CFASTCALL
java_nio_charset_CharsetEncoder__reset__( java_nio_charset_CharsetEncoder
 This )
{
 {
  JCGO_FIELD_NZACCESS(This, state)= java_nio_charset_CharsetEncoder__STATE_RESET;
  (JCGO_CALL_NZVFUNC(This)->implReset__(
   This));
  return This;
 }
}

JCGO_NOSEP_DATA CONST struct jcgo_methods_s java_nio_charset_CharsetEncoder_methods=
{
 JCGO_CLASSREF_OF(java_nio_charset_CharsetEncoder__class),
 JCGO_GCJDESCR_ZEROINIT
 OBJT_java_nio_charset_CharsetEncoder,
 0,
 NULL,
 JCGO_CLINIT_INIT(0)
 0
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_nio_charset_CharsetEncoder_class_s
 java_nio_charset_CharsetEncoder__class JCGO_THRD_ATTRNONGC=
{
 {
  &java_lang_Class_methods,
  JCGO_MON_INIT
  JCGO_OBJREF_OF(*(java_lang_Object)&java_nio_charset_CharsetEncoder_methods),
  JCGO_STRREF_OF(jcgo_string1_ChrstEnc),
  JCGO_CLASSREF_OF(java_lang_Object__class),
  ((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
  0x501
 }
};

JCGO_NOSEP_DATA jcgo_arrtype2_VMChnnl jcgo_array2_ChrstEnc ATTRIBNONGC=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 1,
 {
  (jbyte)(jchar)63/*'?'*/
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype73_GmCnnctn jcgo_array6_ChrstEnc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 31,
 {
  (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)67/*'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)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 CONST jcgo_arrtype98_GmCnnctn jcgo_array7_ChrstEnc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 32,
 {
  (jbyte)(jchar)78/*'N'*/, (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)110/*'n'*/,
   (jbyte)(jchar)45/*'-'*/, (jbyte)(jchar)112/*'p'*/, (jbyte)(jchar)111/*'o'*/,
   (jbyte)(jchar)115/*'s'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)116/*'t'*/,
   (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)118/*'v'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)32/*' '*/, (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)118/*'v'*/,
   (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)114/*'r'*/, (jbyte)(jchar)97/*'a'*/,
   (jbyte)(jchar)103/*'g'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)66/*'B'*/,
   (jbyte)(jchar)121/*'y'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)115/*'s'*/, (jbyte)(jchar)80/*'P'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)114/*'r'*/, (jbyte)(jchar)67/*'C'*/, (jbyte)(jchar)104/*'h'*/,
   (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)114/*'r'*/
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype90_GmCnnctn jcgo_array8_ChrstEnc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 28,
 {
  (jbyte)(jchar)78/*'N'*/, (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)110/*'n'*/,
   (jbyte)(jchar)45/*'-'*/, (jbyte)(jchar)112/*'p'*/, (jbyte)(jchar)111/*'o'*/,
   (jbyte)(jchar)115/*'s'*/, (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)116/*'t'*/,
   (jbyte)(jchar)105/*'i'*/, (jbyte)(jchar)118/*'v'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)32/*' '*/, (jbyte)(jchar)109/*'m'*/, (jbyte)(jchar)97/*'a'*/,
   (jbyte)(jchar)120/*'x'*/, (jbyte)(jchar)66/*'B'*/, (jbyte)(jchar)121/*'y'*/,
   (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)115/*'s'*/,
   (jbyte)(jchar)80/*'P'*/, (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)114/*'r'*/,
   (jbyte)(jchar)67/*'C'*/, (jbyte)(jchar)104/*'h'*/, (jbyte)(jchar)97/*'a'*/,
   (jbyte)(jchar)114/*'r'*/
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype28_Object jcgo_array9_ChrstEnc=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 11,
 {
  (jbyte)(jchar)78/*'N'*/, (jbyte)(jchar)117/*'u'*/, (jbyte)(jchar)108/*'l'*/,
   (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)32/*' '*/, (jbyte)(jchar)97/*'a'*/,
   (jbyte)(jchar)99/*'c'*/, (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)105/*'i'*/,
   (jbyte)(jchar)111/*'o'*/, (jbyte)(jchar)110/*'n'*/
 }
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_ChrstEnc
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array6_ChrstEnc),
 0, 31, (jint)0xa32d0b98L
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string3_ChrstEnc
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array7_ChrstEnc),
 0, 32, (jint)0x320a4c5eL
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string4_ChrstEnc
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array8_ChrstEnc),
 0, 28, (jint)0x4d5185a5L
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string5_ChrstEnc
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array9_ChrstEnc),
 0, 11, (jint)0xab13d2cfL
};

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

#endif
