Esempio n. 1
0
        public int Read()
        {
            int c = -1;

            if (ins == null)
            {
                return(c);
            }
            return(c = ins.ReadByte());
        }
Esempio n. 2
0
        static void LoadResToMemory()
        {
            Stream    stream    = null;
            ArrayByte resStream = null;

            try
            {
                stream    = XNAConfig.LoadStream(LSystem.FRAMEWORK_IMG_NAME + "font.zip");
                resStream = new ArrayByte(new GZipInputStream(stream), ArrayByte.BIG_ENDIAN);
                realsize  = resStream.ReadByte();
                offy      = resStream.ReadByte();
                fontSpace = (realsize + offy) * 2;
                if (realsize > 0x10)
                {
                    fontSpace *= 2;
                }
                int    num        = resStream.ReadInt();
                int    num2       = resStream.ReadByte();
                byte[] bufferData = new byte[resStream.Available()];
                resStream.Read(bufferData);
                fontData = bufferData;
            }
            catch (Exception)
            {
                fontData = null;
            }
            finally
            {
                if (stream != null)
                {
                    stream.Dispose();
                    stream.Close();
                    stream = null;
                }
                if (resStream != null)
                {
                    resStream = null;
                }
            }
        }