Exemplo n.º 1
0
 /// <summary>
 /// Returns the file's total number of bytes.
 /// </summary>
 /// <returns></returns>
 public int GetBytesTotal()
 {
     try
     {
         return((int)mFileStream.length());
     }
     catch (Exception)
     {
         return(0);
     }
 }
Exemplo n.º 2
0
        public VariableLengthRecordFile(String folder, String filename)
        {
            mPathname  = folder;
            mPathname += ("/");
            mPathname += (filename);
            mPathname += (".dat");

            mFileStream = new RandomAccessFile(mPathname);
            if (mFileStream.length() > 0)
            {
                mFileStream.seek(0);
                mBytesUsed = mFileStream.readInt();
            }
            else
            {
                mBytesUsed = 0;
                mFileStream.writeInt(mBytesUsed);
            }
        }