EnumerableMessagePackSerializerBaseTCollection, TItemCreateInstance Method |
Creates a new collection instance with specified initial capacity.
Namespace: MsgPack.Serialization.CollectionSerializersAssembly: MsgPack (in MsgPack.dll) Version: 0.6.0
Syntax protected abstract TCollection CreateInstance(
int initialCapacity
)
Protected MustOverride Function CreateInstance (
initialCapacity As Integer
) As TCollection
protected:
virtual TCollection CreateInstance(
int initialCapacity
) abstract
abstract CreateInstance :
initialCapacity : int -> 'TCollection
Parameters
- initialCapacity
- Type: SystemInt32
The initial capacy of creating collection.
Note that this parameter may 0 for non-empty collection.
Return Value
Type:
TCollection
New collection instance. This value will not be
null.
Remarks
An author of
Unpacker could implement unpacker for non-MessagePack format,
so implementer of this interface should not rely on that
initialCapacity reflects actual items count.
For example, JSON unpacker cannot supply collection items count efficiently.
See Also