Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void write(String fileName) throws java.io.IOException
        public virtual void write(string fileName)
        {
            System.IO.FileStream fileOutputStream     = new System.IO.FileStream(fileName, System.IO.FileMode.Create, System.IO.FileAccess.Write);
            GZIPOutputStream     gzipOutputStream     = new GZIPOutputStream(fileOutputStream);
            BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(gzipOutputStream);
            StateOutputStream    stream = new StateOutputStream(bufferedOutputStream);

            if (log.InfoEnabled)
            {
                Console.WriteLine(string.Format("Writing state to file '{0}'", fileName));
            }

            try
            {
                write(stream);
            }
            finally
            {
                stream.close();
            }

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Done writing state to file '{0}'", fileName));
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void write(StateOutputStream stream) throws java.io.IOException
        public virtual void write(StateOutputStream stream)
        {
            stream.writeVersion(STATE_VERSION);
            Emulator.Clock.write(stream);
            Emulator.Processor.write(stream);
            Emulator.Memory.write(stream);
            HLEModuleManager.Instance.write(stream);
            if (RuntimeContextLLE.LLEActive)
            {
                RuntimeContextLLE.write(stream);
                RuntimeContextLLE.createMMIO();
                RuntimeContextLLE.MMIO.write(stream);
                RuntimeContextLLE.MediaEngineProcessor.write(stream);
                RuntimeContextLLE.MediaEngineProcessor.MEMemory.write(stream);
            }
        }