RandomAccessFile.h

Go to the documentation of this file.
00001 #ifndef JAVA_IO_RANDOMACCESSFILE_H
00002 #define JAVA_IO_RANDOMACCESSFILE_H 1
00003 
00004 #ifndef JAVA_IO_INPUTSTREAM_H
00005 #include <java_io/InputStream.h>
00006 #endif /* JAVA_IO_INPUTSTREAM_H */
00007 #ifndef JAVA_IO_OUTPUTSTREAM_H
00008 #include <java_io/OutputStream.h>
00009 #endif /* JAVA_IO_OUTPUTSTREAM_H */
00010 #ifndef JAVA_IO_FILEDESCRIPTOR_H
00011 #include <java_io/FileDescriptor.h>
00012 #endif /* JAVA_IO_FILEDESCRIPTOR_H */
00013 #ifndef JAVA_IO_FILE_H
00014 #include <java_io/File.h>
00015 #endif /* JAVA_IO_FILE_H */
00016 
00017 namespace java {
00018   namespace io {
00019 
00047     class JAVA_IO_SPEC RandomAccessFile 
00048       : virtual public Object
00049       , virtual public InputStream
00050       , virtual public OutputStream {
00051 
00052     public:
00053 
00089         RandomAccessFile(const String& name = nilString, const String& mode = "rw");
00090   
00159         RandomAccessFile(const File& file, const String& mode = "rw");
00160 
00168         FileDescriptor getFD();
00169 
00185         virtual jint read();
00186 
00205         virtual jint read(Array<jbyte>& b, jint off = 0, jint len = -1);
00206 
00225         virtual jlong skip(jlong n);
00226 
00242         virtual jint available();
00243 
00255         virtual void write(jint b);
00256 
00268         virtual void write(const Array<jbyte>& b, jint off = 0, jint len = -1);
00269 
00282         virtual void flush();
00283 
00298         virtual void close();
00299 
00307         jlong getFilePointer();
00308 
00323         void seek(jlong pos);
00324 
00331         jlong length();
00332 
00352         void setLength(jlong newLength);
00353 
00354     private:
00355 
00356         ObjectRef impl;
00357         REGISTER_MEMBERS;
00358     
00359       };
00360 
00361   } // namespace io
00362 } // namespace java
00363 
00364 #endif /* JAVA_IO_RANDOMACCESSFILE_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3