예제 #1
0
 public ChunkInd(ref ChunkPtr8 c)
 {
     Code   = (DnaID)c.Code;
     Length = c.Length;
     OldPtr = c.UniqueInt1 + c.UniqueInt2 << 32;
     DnaNR  = c.DnaNR;
     NR     = c.NR;
 }
예제 #2
0
 public ChunkInd(ref ChunkPtr8 c)
 {
     Code = (DnaID)c.Code;
     Length = c.Length;
     OldPtr = c.UniqueInt1 + ((long)c.UniqueInt2 << 32);
     DnaNR = c.DnaNR;
     NR = c.NR;
 }
예제 #3
0
        // buffer offset util
        protected int GetNextBlock(out ChunkInd dataChunk, BinaryReader reader, FileFlags flags)
        {
            bool swap   = false;
            bool varies = false;

            if ((flags & FileFlags.EndianSwap) == FileFlags.EndianSwap)
            {
                swap = true;
            }
            if ((flags & FileFlags.BitsVaries) == FileFlags.BitsVaries)
            {
                varies = true;
            }

            if (swap)
            {
                throw new NotImplementedException();
            }

            dataChunk = new ChunkInd();

            if (IntPtr.Size == 8)
            {
                if (varies)
                {
                    ChunkPtr4 c = new ChunkPtr4(reader);
                    dataChunk = new ChunkInd(ref c);
                }
                else
                {
                    ChunkPtr8 c = new ChunkPtr8(reader);
                    dataChunk = new ChunkInd(ref c);
                }
            }
            else
            {
                if (varies)
                {
                    throw new NotImplementedException();
                }
                else
                {
                    ChunkPtr4 c = new ChunkPtr4(reader);
                    dataChunk = new ChunkInd(ref c);
                }
            }

            if (dataChunk.Length < 0)
            {
                return(-1);
            }

            return(dataChunk.Length + ChunkUtils.GetOffset(flags));
        }
예제 #4
0
        // buffer offset util
        protected int GetNextBlock(out ChunkInd dataChunk, BinaryReader reader, FileFlags flags)
        {
            bool swap = false;
            bool varies = false;

            if ((flags & FileFlags.EndianSwap) == FileFlags.EndianSwap)
                swap = true;
            if ((flags & FileFlags.BitsVaries) == FileFlags.BitsVaries)
                varies = true;

            if (swap)
            {
                throw new NotImplementedException();
            }

            dataChunk = new ChunkInd();

            if (IntPtr.Size == 8)
            {
                if (varies)
                {
                    ChunkPtr4 c = new ChunkPtr4(reader);
                    dataChunk = new ChunkInd(ref c);
                }
                else
                {
                    ChunkPtr8 c = new ChunkPtr8(reader);
                    dataChunk = new ChunkInd(ref c);
                }
            }
            else
            {
                if (varies)
                {
                    throw new NotImplementedException();
                }
                else
                {
                    ChunkPtr4 c = new ChunkPtr4(reader);
                    dataChunk = new ChunkInd(ref c);
                }
            }

            if (dataChunk.Length < 0)
                return -1;

            return dataChunk.Length + ChunkUtils.GetOffset(flags);
        }