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

#ifndef __gnu_java_nio_FileChannelImpl__
#define __gnu_java_nio_FileChannelImpl__

#pragma interface

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

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

class ::gnu::java::nio::FileChannelImpl : public ::java::nio::channels::FileChannel
{
private:
  jlong lengthInternal (jint);
public:
  FileChannelImpl (jint, ::java::lang::Object *);
  virtual jlong size ();
public:  // actually protected
  virtual void implCloseChannel ();
public:
  virtual jint read (::java::nio::ByteBuffer *);
  virtual jint read (::java::nio::ByteBuffer *, jlong);
  virtual jlong read (JArray< ::java::nio::ByteBuffer *> *, jint, jint);
  virtual jint write (::java::nio::ByteBuffer *);
  virtual jint write (::java::nio::ByteBuffer *, jlong);
  virtual jlong write (JArray< ::java::nio::ByteBuffer *> *, jint, jint);
  virtual ::java::nio::MappedByteBuffer *map (::java::nio::channels::FileChannel$MapMode *, jlong, jlong);
public: // actually package-private
  static ::java::nio::MappedByteBuffer *create_direct_mapped_buffer (jlong, jlong) { return 0; }
public:
  virtual jlong write (JArray< ::java::nio::ByteBuffer *> *);
  virtual void force (jboolean);
  virtual jlong transferTo (jlong, jlong, ::java::nio::channels::WritableByteChannel *);
  virtual jlong transferFrom (::java::nio::channels::ReadableByteChannel *, jlong, jlong);
  virtual ::java::nio::channels::FileLock *lock (jlong, jlong, jboolean);
  virtual ::java::nio::channels::FileLock *tryLock (jlong, jlong, jboolean);
  virtual jlong position ();
  virtual ::java::nio::channels::FileChannel *position (jlong);
  virtual ::java::nio::channels::FileChannel *truncate (jlong);
private:
  static jlong nio_mmap_file (jint, jlong, jint, jint);
  static void nio_unmmap_file (jint, jlong, jint);
  static void nio_msync (jint, jlong, jint);
public:
  jlong __attribute__((aligned(__alignof__( ::java::nio::channels::FileChannel ))))  address;
  jint length;
  jint fd;
  ::java::nio::MappedByteBuffer *buf;
  ::java::lang::Object *file_obj;

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

#endif /* __gnu_java_nio_FileChannelImpl__ */
