ImageMagick.ExifWriter.WriteValue C# (CSharp) Method

WriteValue() private static method

private static WriteValue ( ExifDataType dataType, object value, byte destination, int offset ) : int
dataType ExifDataType
value object
destination byte
offset int
return int
    private static int WriteValue(ExifDataType dataType, object value, byte[] destination, int offset)
    {
      switch (dataType)
      {
        case ExifDataType.Ascii:
          return Write(Encoding.UTF8.GetBytes((string)value), destination, offset);
        case ExifDataType.Byte:
        case ExifDataType.Undefined:
          destination[offset] = (byte)value;
          return offset + 1;
        case ExifDataType.DoubleFloat:
          return Write(BitConverter.GetBytes((double)value), destination, offset);
        case ExifDataType.Short:
          return Write(BitConverter.GetBytes((ushort)value), destination, offset);
        case ExifDataType.Long:
          return Write(BitConverter.GetBytes((uint)value), destination, offset);
        case ExifDataType.Rational:
          return WriteRational((Rational)value, destination, offset);
        case ExifDataType.SignedByte:
          destination[offset] = unchecked((byte)((sbyte)value));
          return offset + 1;
        case ExifDataType.SignedLong:
          return Write(BitConverter.GetBytes((int)value), destination, offset);
        case ExifDataType.SignedShort:
          return Write(BitConverter.GetBytes((short)value), destination, offset);
        case ExifDataType.SignedRational:
          return WriteSignedRational((SignedRational)value, destination, offset);
        case ExifDataType.SingleFloat:
          return Write(BitConverter.GetBytes((float)value), destination, offset);
        default:
          throw new NotSupportedException();
      }
    }

Same methods

ExifWriter::WriteValue ( ExifValue value, byte destination, int offset ) : int