コード例 #1
0
        private Int32 EnterChunk()
        {
            if (!Reader.IsBinary)
            {
                if (Program.Writer != null)
                {
                    Program.Writer.WriteLine(Path.GetFileName(Reader.FileStream.Name));
                }

                Console.WriteLine("Text mode is not supported!");
                return(0);
            }

            StoChunkHeader header = null;
            var            r      = StoChunkHeader.Read(Reader.Reader, ref header);

            if ((r | Result) < 0)
            {
                return(-1);
            }

            Header = header;

            return(0);
        }
コード例 #2
0
        public static Int32 Read(BinaryReader reader, ref StoChunkHeader header)
        {
            if (reader.BaseStream.Length - reader.BaseStream.Position < 16)
            {
                return(-1);
            }

            header = new StoChunkHeader
            {
                Name     = reader.ReadUInt32(),
                Size     = reader.ReadInt32(),
                Version  = reader.ReadUInt32(),
                Reserved = reader.ReadInt32()
            };
            return(0);
        }