Example #1
0
 public ChunkInd(ref ChunkPtr4 c)
 {
     Code   = (DnaID)c.Code;
     Length = c.Length;
     OldPtr = c.UniqueInt1;
     DnaNR  = c.DnaNR;
     NR     = c.NR;
 }
Example #2
0
 public ChunkInd(ref ChunkPtr4 c)
 {
     Code = (DnaID)c.Code;
     Length = c.Length;
     OldPtr = c.UniqueInt1;
     DnaNR = c.DnaNR;
     NR = c.NR;
 }
Example #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));
        }
Example #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);
        }