コード例 #1
0
 public double ReadDouble(EndianStyle endianstyle)
 {
     byte[] buffer = base.ReadBytes(0x08);
     if (endianstyle == EndianStyle.BigEndian)
     {
         Array.Reverse(buffer);
     }
     return(BitConverter.ToDouble(buffer, 0));
 }
コード例 #2
0
 public long ReadInt64(EndianStyle endianstyle)
 {
     byte[] buffer = base.ReadBytes(0x08);
     if (endianstyle == EndianStyle.BigEndian)
     {
         Array.Reverse(buffer);
     }
     return(BitConverter.ToInt64(buffer, 0));
 }
コード例 #3
0
 public float ReadSingle(EndianStyle endianstyle)
 {
     byte[] Buffer = base.ReadBytes(0x04);
     if (endianstyle == EndianStyle.BigEndian)
     {
         Array.Reverse(Buffer);
     }
     return(BitConverter.ToSingle(Buffer, 0));
 }
コード例 #4
0
 public EndianIO(string FilePath, EndianStyle EndianStyle, FileMode FileMode)
 {
     this._filePath = string.Empty;
     this._endianStyle = EndianStyle.LittleEndian;
     this._endianStyle = EndianStyle;
     this._filePath = FilePath;
     this._isFile = true;
     this.Open(FileMode);
 }
コード例 #5
0
 public EndianIO(string filepath, EndianStyle endianstyle)
 {
     this.filePath    = string.Empty;
     this.endianStyle = EndianStyle.LittleEndian;
     this.endianStyle = endianstyle;
     this.filePath    = filepath;
     this.isFile      = true;
     this.Open();
 }
コード例 #6
0
 public int ReadInt24(EndianStyle EndianStyle)
 {
     byte[] buffer = base.ReadBytes(3);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         return(((buffer[0] << 0x10) | (buffer[1] << 8)) | buffer[2]);
     }
     return(((buffer[2] << 0x10) | (buffer[1] << 8)) | buffer[0]);
 }
コード例 #7
0
 public long ReadInt64(EndianStyle EndianStyle)
 {
     byte[] array = base.ReadBytes(8);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(array);
     }
     return(BitConverter.ToInt64(array, 0));
 }
コード例 #8
0
ファイル: EndianWriter.cs プロジェクト: XBLHammer/LMAOSoft
 public void Write(long value, EndianStyle EndianStyle)
 {
     byte[] bytes = BitConverter.GetBytes(value);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(bytes);
     }
     base.Write(bytes);
 }
コード例 #9
0
 public ushort ReadUInt16(EndianStyle EndianStyle)
 {
     byte[] array = base.ReadBytes(2);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(array);
     }
     return(BitConverter.ToUInt16(array, 0));
 }
コード例 #10
0
 public EndianIO(byte[] Buffer, EndianStyle EndianStyle)
 {
     this._filePath = string.Empty;
     this._endianStyle = EndianStyle.LittleEndian;
     this._endianStyle = EndianStyle;
     this.Stream = new MemoryStream(Buffer);
     this._isFile = false;
     this.Open();
 }
コード例 #11
0
 public uint ReadUInt32(EndianStyle endianstyle)
 {
     byte[] buffer = base.ReadBytes(0x04);
     if (endianstyle == EndianStyle.BigEndian)
     {
         Array.Reverse(buffer);
     }
     return(BitConverter.ToUInt32(buffer, 0));
 }
コード例 #12
0
ファイル: EndianIO.cs プロジェクト: XBLHammer/ame3.3
 public EndianIO(string filepath, EndianStyle endianstyle, FileMode filemode)
 {
     this.FilePath    = string.Empty;
     this.EndianStyle = EndianStyle.LittleEndian;
     this.EndianStyle = endianstyle;
     this.FilePath    = filepath;
     this.isFile      = true;
     this.Open(filemode);
 }
コード例 #13
0
 public EndianIO(System.IO.Stream Stream, EndianStyle EndianStyle)
 {
     this._filePath = string.Empty;
     this._endianStyle = EndianStyle.LittleEndian;
     this._endianStyle = EndianStyle;
     this.Stream = Stream;
     this._isFile = false;
     this.Open();
 }
コード例 #14
0
ファイル: EndianIO.cs プロジェクト: XBLHammer/ame3.3
 public EndianIO(Stream stream, EndianStyle endianstyle)
 {
     this.FilePath    = string.Empty;
     this.EndianStyle = EndianStyle.LittleEndian;
     this.EndianStyle = endianstyle;
     this.Stream      = stream;
     this.isFile      = false;
     this.Open();
 }
コード例 #15
0
ファイル: EndianIO.cs プロジェクト: XBLHammer/ame3.3
 public EndianIO(byte[] buffer, EndianStyle endianstyle)
 {
     this.FilePath    = string.Empty;
     this.EndianStyle = EndianStyle.LittleEndian;
     this.EndianStyle = endianstyle;
     this.Stream      = new MemoryStream(buffer);
     this.isFile      = false;
     this.Open();
 }
コード例 #16
0
 public int ReadInt32(EndianStyle EndianStyle)
 {
     byte[] array = base.ReadBytes(4);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(array);
     }
     return(BitConverter.ToInt32(array, 0));
 }
コード例 #17
0
 public bool ReadBoolean(EndianStyle EndianStyle)
 {
     byte[] array = base.ReadBytes(1);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(array);
     }
     return(BitConverter.ToBoolean(array, 0));
 }
コード例 #18
0
ファイル: EndianWriter.cs プロジェクト: XBLHammer/ame3.3
 public void Write(double value, EndianStyle endianstyle)
 {
     byte[] buffer = BitConverter.GetBytes(value);
     if (endianstyle == EndianStyle.BigEndian)
     {
         Array.Reverse(buffer);
     }
     base.Write(buffer);
 }
コード例 #19
0
 public float ReadSingle(EndianStyle EndianStyle)
 {
     byte[] array = base.ReadBytes(4);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(array);
     }
     return(BitConverter.ToSingle(array, 0));
 }
コード例 #20
0
 public double ReadDouble(EndianStyle EndianStyle)
 {
     byte[] array = base.ReadBytes(8);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(array);
     }
     return(BitConverter.ToDouble(array, 0));
 }
コード例 #21
0
ファイル: EndianWriter.cs プロジェクト: XBLHammer/ame3.3
 public void WriteInt24(int value, EndianStyle endianstyle)
 {
     byte[] Buffer = BitConverter.GetBytes(value);
     Array.Resize <byte>(ref Buffer, 3);
     if (endianstyle == EndianStyle.BigEndian)
     {
         Array.Reverse(Buffer);
     }
     base.Write(Buffer);
 }
コード例 #22
0
 public void WriteInt24(int value, EndianStyle EndianStyle)
 {
     byte[] bytes = BitConverter.GetBytes(value);
     Array.Resize <byte>(ref bytes, 3);
     if (EndianStyle == EndianStyle.BigEndian)
     {
         Array.Reverse(bytes);
     }
     base.Write(bytes);
 }
コード例 #23
0
        public int ReadInt32(EndianStyle endianstyle)
        {
            byte[] bytes = base.ReadBytes(4);
            if (endianstyle == EndianStyle.BigEndian)
            {
                Array.Reverse(bytes);
            }

            return(BitConverter.ToInt32(bytes, 0));
        }
コード例 #24
0
        public ushort ReadUInt16(EndianStyle endianstyle)
        {
            byte[] bytes = base.ReadBytes(2);
            if (endianstyle == EndianStyle.BigEndian)
            {
                Array.Reverse(bytes);
            }

            return(BitConverter.ToUInt16(bytes, 0));
        }
コード例 #25
0
        public ulong ReadUInt64(EndianStyle endianstyle)
        {
            byte[] bytes = base.ReadBytes(8);
            if (endianstyle == EndianStyle.BigEndian)
            {
                Array.Reverse(bytes);
            }

            return(BitConverter.ToUInt64(bytes, 0));
        }
コード例 #26
0
        public void WriteUnicodeString(string String, int length, EndianStyle endianStyle)
        {
            int num = String.Length;

            for (int i = 0; i < num; i++)
            {
                if (i > length)
                {
                    break;
                }
                ushort num3 = String[i];
                this.Write(num3, endianStyle);
            }
            int num4 = (length - num) * 2;

            if (num4 > 0)
            {
                this.Write(new byte[num4]);
            }
        }
コード例 #27
0
        public string ReadUnicodeString(int length, EndianStyle endianStyle)
        {
            string str = string.Empty;
            int    num = 0;

            for (int i = 0; i < length; i++)
            {
                ushort num3 = this.ReadUInt16(endianStyle);
                num++;
                if (num3 == 0)
                {
                    break;
                }
                str = str + ((char)num3);
            }
            int num4 = (length - num) * 2;

            this.BaseStream.Seek((long)num4, SeekOrigin.Current);
            return(str);
        }
コード例 #28
0
ファイル: EndianWriter.cs プロジェクト: XBLHammer/ame3.3
        public void WriteUnicodeString(string str, int length, EndianStyle endianstyle)
        {
            int num = str.Length;

            for (int i = 0; i < num; i++)
            {
                if (i > length)
                {
                    break;
                }
                ushort num2 = str[i];
                this.Write(num2, endianstyle);
            }
            int num3 = (length - num) * 2;

            if (num3 > 0)
            {
                this.Write(new byte[num3]);
            }
        }
コード例 #29
0
 public EndianWriter(Stream Stream, EndianStyle EndianStyle) : base(Stream)
 {
     this._endianStyle = EndianStyle;
 }
コード例 #30
0
 public EndianWriter(Stream stream, EndianStyle endianstyle)
     : base(stream)
 {
     this.endianStyle = endianstyle;
 }