public override string ToTextualConvention(Node node) { if (node.Master.Equals(this)) { return(BaseMediaReader.ToUTF8FourCharacterCode(node.Identifier)); } return(base.ToTextualConvention(node)); }
public static Guid GetUniqueIdentifier(BaseMediaReader reader, Node node) { //Allocate the 16 bytes for the uuid byte[] uuidBytes = new byte[BytesPerUUID]; //If the node is a UUID type if (IsUserDefinedNode(reader, node)) { //Read the UUID from the identifier which comes after the uuid name. Array.Copy(node.Identifier, IdentifierSize, uuidBytes, 0, BytesPerUUID); } else { //Copy the identifier to the uuid Array.Copy(node.Identifier, 0, uuidBytes, 0, IdentifierSize); //Copy the template value to the uuid after the identifier Array.Copy(IsoUUIDTemplate, IdentifierSize, uuidBytes, IdentifierSize, TemplateSize); } //Return the result of parsing a Guid from the uuid bytes. The UUID should be in big endian format... //BitOrder == LeastSignificant return(Common.Binary.ReadGuid(uuidBytes, 0, Common.Binary.IsLittleEndian)); //new Guid(uuidBytes); }
public static bool IsUserDefinedIdentifier(BaseMediaReader reader, byte[] identifier, int offset = 0, int count = 4) { return(ToUTF8FourCharacterCode(identifier, offset, count) == UserDefined); }
public static bool IsUserDefinedNode(BaseMediaReader reader, Node node) { return(IsUserDefinedIdentifier(reader, node.Identifier)); }