C# Class MsgPack.MessagePackConvert

Define common convert rountines specific to MessagePack.
Mostrar archivo Open project: msgpack/msgpack-cli Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
DecodeStringStrict ( byte value ) : string

Decode specified byte[] by default encoding.

EncodeString ( string value ) : byte[]

Encode specified string by default encoding.

FromDateTime ( System.DateTime value ) : long

Convert specified DateTime to Int64 as MessagePack defacto-standard.

FromDateTimeOffset ( DateTimeOffset value ) : long

Convert specified DateTimeOffset to Int64 as MessagePack defacto-standard.

ToDateTime ( long value ) : System.DateTime

Convert specified Int64 to DateTime.

ToDateTimeOffset ( long value ) : DateTimeOffset

Convert specified Int64 to DateTimeOffset.

Method Details

DecodeStringStrict() public static method

Decode specified byte[] by default encoding.
/// is null. /// /// contains non-UTF-8 bits. ///
public static DecodeStringStrict ( byte value ) : string
value byte Byte[] value.
return string

EncodeString() public static method

Encode specified string by default encoding.
/// is null. ///
public static EncodeString ( string value ) : byte[]
value string String value.
return byte[]

FromDateTime() public static method

Convert specified DateTime to Int64 as MessagePack defacto-standard.
public static FromDateTime ( System.DateTime value ) : long
value System.DateTime .
return long

FromDateTimeOffset() public static method

Convert specified DateTimeOffset to Int64 as MessagePack defacto-standard.
public static FromDateTimeOffset ( DateTimeOffset value ) : long
value DateTimeOffset .
return long

ToDateTime() public static method

Convert specified Int64 to DateTime.
public static ToDateTime ( long value ) : System.DateTime
value long /// value which is unpacked from packed message and may represent date-time value. ///
return System.DateTime

ToDateTimeOffset() public static method

Convert specified Int64 to DateTimeOffset.
public static ToDateTimeOffset ( long value ) : DateTimeOffset
value long /// value which is unpacked from packed message and may represent date-time value. ///
return DateTimeOffset