示例#1
0
        private void StcoExtend(Atom stco, Atom mdat, ArrayList offsetsInMdat)
        {
            byte[] newPayload = new byte[2 * 4 + offsetsInMdat.Count * 8];

            /* read 8 bytes - version, flags and entry count */
            InFile.ReadBytes(stco.PayloadFileOffset, newPayload, 8);

            /* apply changes */
            stco.Type        = "co64";
            stco.PayloadData = newPayload;
        }
        private string GetAtomType(InputFile file, ulong position)
        {
            string type = "";
            byte[] buffer = new byte[4];

            file.ReadBytes(position + 4, buffer, 4);

            for (int pos = 0; pos < 4; pos++)
            {
                type += (char)buffer[pos];
            }

            return type;
        }
示例#3
0
        private string GetAtomType(InputFile file, ulong position)
        {
            string type = "";

            byte[] buffer = new byte[4];

            file.ReadBytes(position + 4, buffer, 4);

            for (int pos = 0; pos < 4; pos++)
            {
                type += (char)buffer[pos];
            }

            return(type);
        }
示例#4
0
        internal void WriteFromInput(InputFile inFile, ulong position, ulong length)
        {
            ulong blockSize = 8 * 1024 * 1024;
            ulong remaining = length;

            while (remaining > 0)
            {
                byte[] buf = new byte[Math.Min(remaining, blockSize)];
                inFile.ReadBytes(position, buf, buf.Length);
                writer.Write(buf);

                remaining -= (ulong)buf.Length;
                position  += (ulong)buf.Length;
            }
        }
示例#5
0
        internal void WriteFromInput(InputFile inFile, ulong position, ulong length)
        {
            ulong blockSize = 8 * 1024 * 1024;
            ulong remaining = length;

            while(remaining>0)
            {
                byte[] buf = new byte[Math.Min(remaining, blockSize)];
                inFile.ReadBytes(position, buf, buf.Length);
                writer.Write(buf);

                remaining -= (ulong)buf.Length;
                position += (ulong)buf.Length;
            }
        }