コード例 #1
0
 public HandlerBox(BoxLocation location, SequentialReader reader)
     : base(location, reader)
 {
     reader.GetUInt32(); // should be Zero
     HandlerType = reader.GetUInt32();
     reader.GetUInt32(); // should be Zero
     reader.GetUInt32(); // should be Zero
     reader.GetUInt32(); // should be Zero
     TrackType = reader.GetString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
 }
コード例 #2
0
        private const uint UriTag  = 0x75726920; // fdel

        public ItemInfoEntryBox(BoxLocation location, SequentialReader reader)
            : base(location, reader)
        {
            if (Version <= 1)
            {
                ItemId = reader.GetUInt16();
                ItemProtectionIndex = reader.GetUInt16();
                ItemName            = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
            }

            if (Version == 1)
            {
                ExtensionType = reader.GetUInt32();
                if (ExtensionType == FdelTag)
                {
                    Location       = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
                    MD5            = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
                    ContentLength  = reader.GetUInt64();
                    TransferLength = reader.GetUInt64();
                    GroupIdCount   = reader.GetByte();
                    GroupIds       = new uint[GroupIdCount];
                    for (int i = 0; i < GroupIdCount; i++)
                    {
                        GroupIds[i] = reader.GetUInt32();
                    }
                }
            }

            if (Version >= 2)
            {
                ItemId = Version == 2 ? reader.GetUInt16() : reader.GetUInt32();
                ItemProtectionIndex = reader.GetUInt16();
                ItemType            = reader.GetUInt32();
                ItemName            = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);

                if (ItemType == MimeTag)
                {
                    ContentType     = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
                    ContentEncoding = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
                }

                if (ItemType == UriTag)
                {
                    ItemUri = reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
                }
            }
        }
コード例 #3
0
 public DataEntryLocationBox(BoxLocation location, SequentialReader reader, bool hasName)
     : base(location, reader)
 {
     Name     = hasName ? reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8) : "";
     Location = !reader.IsWithinBox(location) ? "" : reader.GetNullTerminatedString((int)reader.BytesRemainingInBox(location), Encoding.UTF8);
 }