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

#ifndef __gnu_java_nio_channels_FileChannelImpl__
#define __gnu_java_nio_channels_FileChannelImpl__

#pragma interface

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

extern "Java"
{
  namespace java
  {
    namespace nio
    {
      namespace channels
      {
        class FileChannel;
        class FileLock;
        class ReadableByteChannel;
        class WritableByteChannel;
        class FileChannel$MapMode;
      }
      class MappedByteBuffer;
      class ByteBuffer;
    }
  }
  namespace gnu
  {
    namespace java
    {
      namespace nio
      {
        namespace channels
        {
          class FileChannelImpl;
        }
      }
    }
  }
}

class gnu::java::nio::channels::FileChannelImpl : public ::java::nio::channels::FileChannel
{
private:
  static void init ();
public:
  FileChannelImpl ();
  static ::gnu::java::nio::channels::FileChannelImpl *create (::java::io::File *, jint);
private:
  FileChannelImpl (::java::io::File *, jint);
public: // actually package-private
  FileChannelImpl (jint, jint);
private:
  jint open (::java::lang::String *, jint);
public:
  virtual jint available ();
private:
  jlong implPosition ();
  void seek (jlong);
  void implTruncate (jlong);
public:
  virtual void unlock (jlong, jlong);
  virtual jlong size ();
public:  // actually protected
  virtual void implCloseChannel ();
  virtual void finalize ();
public:
  virtual jint read (::java::nio::ByteBuffer *);
  virtual jint read (::java::nio::ByteBuffer *, jlong);
  virtual jint read ();
  virtual jint read (jbyteArray, jint, jint);
  virtual jlong read (JArray< ::java::nio::ByteBuffer *> *, jint, jint);
  virtual jint write (::java::nio::ByteBuffer *);
  virtual jint write (::java::nio::ByteBuffer *, jlong);
  virtual void write (jbyteArray, jint, jint);
  virtual void write (jint);
  virtual jlong write (JArray< ::java::nio::ByteBuffer *> *, jint, jint);
  virtual ::java::nio::MappedByteBuffer *mapImpl (jchar, jlong, jint);
  virtual ::java::nio::MappedByteBuffer *map (::java::nio::channels::FileChannel$MapMode *, jlong, jlong);
  virtual void force (jboolean);
private:
  jint smallTransferTo (jlong, jint, ::java::nio::channels::WritableByteChannel *);
public:
  virtual jlong transferTo (jlong, jlong, ::java::nio::channels::WritableByteChannel *);
private:
  jint smallTransferFrom (::java::nio::channels::ReadableByteChannel *, jlong, jint);
public:
  virtual jlong transferFrom (::java::nio::channels::ReadableByteChannel *, jlong, jlong);
  virtual ::java::nio::channels::FileLock *tryLock (jlong, jlong, jboolean);
private:
  jboolean lock (jlong, jlong, jboolean, jboolean);
public:
  virtual ::java::nio::channels::FileLock *lock (jlong, jlong, jboolean);
  virtual jlong position ();
  virtual ::java::nio::channels::FileChannel *position (jlong);
  virtual ::java::nio::channels::FileChannel *truncate (jlong);
  static const jint READ = 1L;
  static const jint WRITE = 2L;
  static const jint APPEND = 4L;
  static const jint EXCL = 8L;
  static const jint SYNC = 16L;
  static const jint DSYNC = 32L;
private:
  jint __attribute__((aligned(__alignof__( ::java::nio::channels::FileChannel ))))  fd;
  jlong pos;
  jint mode;
public:
  static ::gnu::java::nio::channels::FileChannelImpl *in;
  static ::gnu::java::nio::channels::FileChannelImpl *out;
  static ::gnu::java::nio::channels::FileChannelImpl *err;

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

#endif /* __gnu_java_nio_channels_FileChannelImpl__ */
