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

JCGO_NOSEP_INLINE gnu_java_nio_SocketChannelImpl CFASTCALL
gnu_java_nio_SocketChannelImpl__this__L6sfa6Z( gnu_java_nio_SocketChannelImpl
 This, java_nio_channels_spi_SelectorProvider provider, jboolean create
 )
{
 {
  (gnu_java_nio_SocketChannelImpl__this__L6sfa6L59mndZ((gnu_java_nio_SocketChannelImpl)This,
   provider, gnu_java_nio_VMChannel__new__(), (jboolean)create));
 }
 return This;
}

JCGO_NOSEP_FRWINL gnu_java_nio_SocketChannelImpl CFASTCALL
gnu_java_nio_SocketChannelImpl__this__L6sfa6L59mndZ( gnu_java_nio_SocketChannelImpl
 This, java_nio_channels_spi_SelectorProvider provider, gnu_java_nio_VMChannel
 channel, jboolean create )
{
 {
  (java_nio_channels_SocketChannel__this__L6sfa6((java_nio_channels_SocketChannel)This,
   provider));
  JCGO_FIELD_NZACCESS(This, channel)= channel;
  if (create)
  {
   (JCGO_CALL_FINALF(channel) gnu_java_nio_VMChannel__initSocket__Z(
    channel, (jboolean)jtrue));
  }
  (void)(gnu_java_nio_NIOSocket__new__L498l2(
   This));
  (java_nio_channels_spi_AbstractSelectableChannel__configureBlocking__Z(
   (java_nio_channels_spi_AbstractSelectableChannel)This, (jboolean)jtrue));
 }
 return This;
}

JCGO_NOSEP_INLINE gnu_java_nio_SocketChannelImpl CFASTCALL
gnu_java_nio_SocketChannelImpl__this__Z( gnu_java_nio_SocketChannelImpl
 This, jboolean create )
{
 {
  (gnu_java_nio_SocketChannelImpl__this__L6sfa6Z((gnu_java_nio_SocketChannelImpl)This,
   (java_nio_channels_spi_SelectorProvider)gnu_java_nio_SelectorProviderImpl__new__(),
   (jboolean)create));
 }
 return This;
}

JCGO_NOSEP_INLINE gnu_java_nio_SocketChannelImpl CFASTCALL
gnu_java_nio_SocketChannelImpl__new__Z( jboolean create )
{
 return gnu_java_nio_SocketChannelImpl__this__Z(
  (gnu_java_nio_SocketChannelImpl)jcgo_newObject((jvtable)&gnu_java_nio_SocketChannelImpl_methods),
  create);
}

JCGO_NOSEP_FRWINL void CFASTCALL
gnu_java_nio_SocketChannelImpl__implCloseSelectableChannel__( gnu_java_nio_SocketChannelImpl
 This )
{
 {
  jObject jcgo_rcvrL1;
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, channel), JCGO_CALL_FINALF((gnu_java_nio_VMChannel)jcgo_rcvrL1)
   gnu_java_nio_VMChannel__close__(
   (gnu_java_nio_VMChannel)jcgo_rcvrL1));
 }
}

JCGO_NOSEP_FRWINL void CFASTCALL
gnu_java_nio_SocketChannelImpl__implConfigureBlocking__Z( gnu_java_nio_SocketChannelImpl
 This, jboolean blocking )
{
 {
  jObject jcgo_rcvrL1;
  (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, channel), JCGO_CALL_FINALF((gnu_java_nio_VMChannel)jcgo_rcvrL1)
   gnu_java_nio_VMChannel__setBlocking__Z(
   (gnu_java_nio_VMChannel)jcgo_rcvrL1, (jboolean)blocking));
 }
}

JCGO_NOSEP_INLINE jboolean CFASTCALL
gnu_java_nio_SocketChannelImpl__connect__L2kl8gI( gnu_java_nio_SocketChannelImpl
 This, java_net_SocketAddress remote, jint timeout )
{
 {
  jObject jcgo_rcvrL1;
  if (!(java_nio_channels_spi_AbstractInterruptibleChannel__isOpen__(
   (java_nio_channels_spi_AbstractInterruptibleChannel)This)))
  {
   JCGO_THROW_EXC(java_nio_channels_ClosedChannelException__new__());
  }
  if ((gnu_java_nio_SocketChannelImpl__isConnected__(
   This)))
  {
   JCGO_THROW_EXC(java_nio_channels_AlreadyConnectedException__new__());
  }
  if (JCGO_FIELD_NZACCESS(This, connectionPending))
  {
   JCGO_THROW_EXC(java_nio_channels_ConnectionPendingException__new__());
  }
  if (!jcgo_instanceOf0(OBJT_java_net_InetSocketAddress, MAXT_java_net_InetSocketAddress,
   (jObject)remote))
  {
   JCGO_THROW_EXC(java_nio_channels_UnsupportedAddressTypeException__new__());
  }
  JCGO_FIELD_NZACCESS(This, connectAddress)= (java_net_InetSocketAddress)remote;
  if ((jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, connectAddress),
   JCGO_CALL_FINALF((java_net_InetSocketAddress)jcgo_rcvrL1) java_net_InetSocketAddress__isUnresolved__(
   (java_net_InetSocketAddress)jcgo_rcvrL1)))
  {
   JCGO_THROW_EXC(java_nio_channels_UnresolvedAddressException__new__());
  }
  JCGO_FIELD_NZACCESS(This, connected)= (jboolean)(jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This,
   channel), JCGO_CALL_FINALF((gnu_java_nio_VMChannel)jcgo_rcvrL1)
   gnu_java_nio_VMChannel__connect__L5zjctI(
   (gnu_java_nio_VMChannel)jcgo_rcvrL1, JCGO_FIELD_NZACCESS(This, connectAddress),
   timeout));
  JCGO_FIELD_NZACCESS(This, connectionPending)= (jboolean)(!JCGO_FIELD_NZACCESS(This,
   connected));
  return (jboolean)JCGO_FIELD_NZACCESS(This, connected);
 }
}

JCGO_NOSEP_STATIC jboolean CFASTCALL
gnu_java_nio_SocketChannelImpl__isConnected__( gnu_java_nio_SocketChannelImpl
 This )
{
 {
  if (JCGO_FIELD_NZACCESS(This, connectionPending))
  {
   return (jboolean)jfalse;
  }
  {
   JCGO_TRY_BLOCK
   {
    java_net_InetSocketAddress remote;
    jObject jcgo_rcvrL1;
    remote= (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, channel),
     JCGO_CALL_FINALF((gnu_java_nio_VMChannel)jcgo_rcvrL1) gnu_java_nio_VMChannel__getPeerAddress__(
     (gnu_java_nio_VMChannel)jcgo_rcvrL1));
#ifndef JCGO_SEHTRY
    jcgo_tryLeave();
#endif
    return (jboolean)(remote != jnull);
   }
   JCGO_TRY_LEAVE
   JCGO_TRY_CATCHES(1)
   JCGO_TRY_CATCH(OBJT_java_io_IOException, MAXT_java_io_IOException)
   {
    java_io_IOException ioe;
    ioe= (java_io_IOException)JCGO_TRY_THROWABLE(0);
    (java_lang_Throwable__printStackTrace__L18p1o(
     (java_lang_Throwable)ioe, JCGO_CLINIT_VARACC(java_lang_System__class,
     java_lang_System__out)));
    return (jboolean)jfalse;
   }
   JCGO_TRY_RETHROW(1)
  }
 }
 return (jboolean)0;
}

JCGO_NOSEP_INLINE jint CFASTCALL
gnu_java_nio_SocketChannelImpl__read__L9oaia( gnu_java_nio_SocketChannelImpl
 This, java_nio_ByteBuffer dst )
{
 {
  jObject jcgo_rcvrL1;
  if (!(gnu_java_nio_SocketChannelImpl__isConnected__(
   This)))
  {
   JCGO_THROW_EXC(java_nio_channels_NotYetConnectedException__new__());
  }
  return (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, channel),
   JCGO_CALL_FINALF((gnu_java_nio_VMChannel)jcgo_rcvrL1) gnu_java_nio_VMChannel__read__L9oaia(
   (gnu_java_nio_VMChannel)jcgo_rcvrL1, dst));
 }
}

JCGO_NOSEP_INLINE jint CFASTCALL
gnu_java_nio_SocketChannelImpl__write__L9oaia( gnu_java_nio_SocketChannelImpl
 This, java_nio_ByteBuffer src )
{
 {
  jObject jcgo_rcvrL1;
  if (!(gnu_java_nio_SocketChannelImpl__isConnected__(
   This)))
  {
   JCGO_THROW_EXC(java_nio_channels_NotYetConnectedException__new__());
  }
  return (jcgo_rcvrL1= (jObject)JCGO_FIELD_NZACCESS(This, channel),
   JCGO_CALL_FINALF((gnu_java_nio_VMChannel)jcgo_rcvrL1) gnu_java_nio_VMChannel__write__L9oaia(
   (gnu_java_nio_VMChannel)jcgo_rcvrL1, src));
 }
}

JCGO_NOSEP_INLINE gnu_java_nio_VMChannel CFASTCALL
gnu_java_nio_SocketChannelImpl__getVMChannel__( gnu_java_nio_SocketChannelImpl
 This )
{
 {
  return JCGO_FIELD_NZACCESS(This, channel);
 }
}

JCGO_NOSEP_DATA CONST struct gnu_java_nio_SocketChannelImpl_methods_s
 gnu_java_nio_SocketChannelImpl_methods=
{
 JCGO_CLASSREF_OF(gnu_java_nio_SocketChannelImpl__class),
 JCGO_GCJDESCR_INIT(gnu_java_nio_SocketChannelImpl_s, connectAddress)
 OBJT_gnu_java_nio_SocketChannelImpl,
 (JCGO_OBJSIZE_T)sizeof(struct gnu_java_nio_SocketChannelImpl_s),
 NULL,
 JCGO_CLINIT_INIT(0)
 0,
 java_lang_Object__equals__Lo,
 java_lang_Object__hashCode__,
 java_lang_Object__toString__,
 java_lang_Object__finalize__,
 java_nio_channels_spi_AbstractSelectableChannel__implCloseChannel__
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct gnu_java_nio_SocketChannelImpl_class_s
 gnu_java_nio_SocketChannelImpl__class JCGO_THRD_ATTRNONGC=
{
 {
  &java_lang_Class_methods,
  JCGO_MON_INIT
  JCGO_OBJREF_OF(*(java_lang_Object)&gnu_java_nio_SocketChannelImpl_methods),
  JCGO_STRREF_OF(jcgo_string1_ScktChIm),
  JCGO_CLASSREF_OF(java_nio_channels_SocketChannel__class),
  ((jObjectArr)JCGO_OBJREF_OF(jcgo_array3_Object)),
  0x11
 }
};

JCGO_NOSEP_DATA CONST jcgo_arrtype77_GmCnnctn jcgo_array2_ScktChIm=
{
 (jvtable)&jbyteArr_methods,
 JCGO_MON_INIT
 30,
 {
  (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)83/*'S'*/, (jbyte)(jchar)111/*'o'*/,
   (jbyte)(jchar)99/*'c'*/, (jbyte)(jchar)107/*'k'*/, (jbyte)(jchar)101/*'e'*/,
   (jbyte)(jchar)116/*'t'*/, (jbyte)(jchar)67/*'C'*/, (jbyte)(jchar)104/*'h'*/,
   (jbyte)(jchar)97/*'a'*/, (jbyte)(jchar)110/*'n'*/, (jbyte)(jchar)110/*'n'*/,
   (jbyte)(jchar)101/*'e'*/, (jbyte)(jchar)108/*'l'*/, (jbyte)(jchar)73/*'I'*/,
   (jbyte)(jchar)109/*'m'*/, (jbyte)(jchar)112/*'p'*/, (jbyte)(jchar)108/*'l'*/
 }
};

JCGO_NOSEP_DATA JCGO_NOTHR_CONST struct java_lang_String_s jcgo_string1_ScktChIm
 JCGO_THRD_ATTRNONGC=
{
 &java_lang_String_methods,
 JCGO_MON_INIT
 (java_lang_Object)JCGO_OBJREF_OF(jcgo_array2_ScktChIm),
 0, 30, (jint)0xbeb7e58aL
};

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

#endif
