public string Parse(
            MutagenFrame reader,
            bool parseWhole = true,
            StringBinaryType stringBinaryType = StringBinaryType.NullTerminate)
        {
            switch (stringBinaryType)
            {
            case StringBinaryType.Plain:
            case StringBinaryType.NullTerminate:
                if (parseWhole)
                {
                    return(BinaryStringUtility.ProcessWholeToZString(reader.ReadMemory(checked ((int)reader.Remaining))));
                }
                else
                {
                    return(BinaryStringUtility.ParseUnknownLengthString(reader.Reader));
                }

            case StringBinaryType.PrependLength:
            {
                var len = reader.ReadInt32();
                return(BinaryStringUtility.ToZString(reader.ReadMemory(len)));
            }

            case StringBinaryType.PrependLengthUShort:
            {
                var len = reader.ReadInt16();
                return(BinaryStringUtility.ToZString(reader.ReadMemory(len)));
            }

            default:
                throw new NotImplementedException();
            }
        }
 public TranslatedString Parse(
     ReadOnlyMemorySlice <byte> data,
     StringsSource source,
     IStringsFolderLookup?lookup)
 {
     if (lookup != null)
     {
         if (data.Length != 4)
         {
             throw new ArgumentException($"String in Strings File format had unexpected length: {data.Length} != 4");
         }
         uint key = BinaryPrimitives.ReadUInt32LittleEndian(data);
         if (key == 0)
         {
             return(new TranslatedString(directString: null));
         }
         return(lookup.CreateString(source, key));
     }
     else
     {
         return(BinaryStringUtility.ProcessWholeToZString(data));
     }
 }