Ejemplo n.º 1
0
        public static void readVFSheaders(string datafile, string indexfile)
        {
            FileStream datastream;
            FileStream indexstream;

            datastream  = File.Open(datafile, FileMode.Open);
            indexstream = File.Open(indexfile, FileMode.Open);

            int offset = 0;

            byte[] blockdata = new byte[indexstream.Length];
            indexstream.Read(blockdata, 0, (int)indexstream.Length);

            while (offset < indexstream.Length)
            {
                VFSblock block = new VFSblock();
                offset = block.readblock(blockdata, offset);

                FileStream writer = File.Open(OpenMetaverse.Settings.RESOURCE_DIR + System.IO.Path.DirectorySeparatorChar + block.mFileID.ToString(), FileMode.Create);
                byte[]     data   = new byte[block.mSize];
                datastream.Seek(block.mLocation, SeekOrigin.Begin);
                datastream.Read(data, 0, block.mSize);
                writer.Write(data, 0, block.mSize);
                writer.Close();
            }
        }
Ejemplo n.º 2
0
        public static void readVFSheaders(string datafile, string indexfile)
        {
            FileStream datastream;
            FileStream indexstream;

            datastream = File.Open(datafile, FileMode.Open);
            indexstream = File.Open(indexfile, FileMode.Open);

            int offset = 0;

            byte[] blockdata = new byte[indexstream.Length];
            indexstream.Read(blockdata, 0, (int)indexstream.Length);

            while (offset < indexstream.Length)
            {
                VFSblock block = new VFSblock();
                offset = block.readblock(blockdata, offset);

                FileStream writer = File.Open(OpenMetaverse.Settings.RESOURCE_DIR + System.IO.Path.DirectorySeparatorChar + block.mFileID.ToString(), FileMode.Create);
                byte[] data = new byte[block.mSize];
                datastream.Seek(block.mLocation, SeekOrigin.Begin);
                datastream.Read(data, 0, block.mSize);
                writer.Write(data, 0, block.mSize);
                writer.Close();
            }
        }