private static void WriteArray(MsgSubStorageWriter writer, TnefPropertyTag propertyTag, int arrayLength, MsgStorageRulesTable.WriteValueDelegate writeValue) { MsgSubStorageWriter.WriterBuffer valueBuffer = writer.ValueBuffer; for (int num = 0; num != arrayLength; num++) { writeValue(valueBuffer.Writer, num); } int length = valueBuffer.GetLength(); byte[] buffer = valueBuffer.GetBuffer(); writer.Storage.WriteBytesToStream(Util.PropertyStreamName(propertyTag), buffer, length); MsgStoragePropertyData.WriteStream(writer.PropertiesWriter, propertyTag, length); }
private static void InternalWriteStringArray(MsgSubStorageWriter writer, TnefPropertyTag propertyTag, string[] arrayValue) { MsgSubStorageWriter.WriterBuffer lengthsBuffer = writer.LengthsBuffer; for (int num = 0; num != arrayValue.Length; num++) { MsgSubStorageWriter.WriterBuffer valueBuffer = writer.ValueBuffer; int unicodeByteCount = Util.GetUnicodeByteCount(arrayValue[num]); byte[] array = valueBuffer.PreallocateBuffer(unicodeByteCount); int num2 = Util.StringToUnicodeBytes(arrayValue[num], array); lengthsBuffer.Writer.Write(num2); writer.Storage.WriteBytesToStream(Util.PropertyStreamName(propertyTag, num), array, num2); } int length = lengthsBuffer.GetLength(); byte[] buffer = lengthsBuffer.GetBuffer(); writer.Storage.WriteBytesToStream(Util.PropertyStreamName(propertyTag), buffer, length); MsgStoragePropertyData.WriteStream(writer.PropertiesWriter, propertyTag, length); }
private static void WriteArrayOfBinary(MsgSubStorageWriter writer, TnefPropertyTag propertyTag, object value) { byte[][] array = value as byte[][]; if (array == null) { throw new InvalidOperationException(MsgStorageStrings.InvalidValueType(typeof(byte[][]), value.GetType())); } MsgSubStorageWriter.WriterBuffer lengthsBuffer = writer.LengthsBuffer; for (int num = 0; num != array.Length; num++) { lengthsBuffer.Writer.Write(array[num].Length); lengthsBuffer.Writer.Write(0); writer.Storage.WriteBytesToStream(Util.PropertyStreamName(propertyTag, num), array[num]); } int length = lengthsBuffer.GetLength(); byte[] buffer = lengthsBuffer.GetBuffer(); writer.Storage.WriteBytesToStream(Util.PropertyStreamName(propertyTag), buffer, length); MsgStoragePropertyData.WriteStream(writer.PropertiesWriter, propertyTag, length); }