// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __gnu_java_nio_SocketChannelImpl__
#define __gnu_java_nio_SocketChannelImpl__

#pragma interface

#include <java/nio/channels/SocketChannel.h>
#include <gcj/array.h>

extern "Java"
{
  namespace gnu
  {
    namespace java
    {
      namespace nio
      {
        class SocketChannelImpl;
      }
    }
  }
  namespace java
  {
    namespace nio
    {
      class ByteBuffer;
      namespace channels
      {
        namespace spi
        {
          class SelectorProvider;
        }
      }
    }
    namespace net
    {
      class SocketAddress;
      class InetAddress;
      class InetSocketAddress;
      class Socket;
    }
  }
};

class ::gnu::java::nio::SocketChannelImpl : public ::java::nio::channels::SocketChannel
{
public: // actually package-private
  static jint SocketCreate ();
  static jint SocketConnect (jint, ::java::net::InetAddress *, jint);
  static jint SocketBind (jint, ::java::net::InetAddress *, jint);
  static jint SocketListen (jint, jint);
  static jint SocketAvailable (jint);
  static jint SocketClose (jint);
  static jint SocketRead (jint, jbyteArray, jint, jint);
  static jint SocketWrite (jint, jbyteArray, jint, jint);
public:
  SocketChannelImpl (::java::nio::channels::spi::SelectorProvider *);
  virtual void finalizer ();
public:  // actually protected
  virtual void implCloseSelectableChannel ();
  virtual void implConfigureBlocking (jboolean);
public:
  virtual jboolean connect (::java::net::SocketAddress *);
  virtual jboolean finishConnect ();
  virtual jboolean isConnected () { return connected; }
  virtual jboolean isConnectionPending ();
  virtual ::java::net::Socket *socket ();
  virtual jint read (::java::nio::ByteBuffer *);
  virtual jlong read (JArray< ::java::nio::ByteBuffer *> *, jint, jint);
  virtual jint write (::java::nio::ByteBuffer *);
  virtual jlong write (JArray< ::java::nio::ByteBuffer *> *, jint, jint);
public: // actually package-private
  ::java::net::Socket * __attribute__((aligned(__alignof__( ::java::nio::channels::SocketChannel )))) sock_object;
  jint fd;
  jint local_port;
  jboolean blocking;
  jboolean connected;
  ::java::net::InetSocketAddress *sa;
public:

  static ::java::lang::Class class$;
};

#endif /* __gnu_java_nio_SocketChannelImpl__ */
