SystemUtil
Description
Provides static helper method for dealing with objects.
This class provides some helper methods, dealing with the following:
-
Clear ranges of arrays of primitive element-types to the default value, see
ArrayClear
. -
Copy ranges between arrays of primitive element-types, see
ArrayCopy
. -
Comparison methods for primitive types, compatible with CompareDelegate, see
Compare*
. -
Equality methods for primitive types, compatible with EqualsDelegate.
-
Helpers for estimating memory consumption, see
MemoryConsumption*
. -
Pin object references, for safely passing them around as IntPtr values.
-
Sort fixed-length sequences of values, see
Sort*
. -
Read and write 64-bit integer values using minimal byte count (between 1 and 9), see
VarInt*
.
Public / Methods
ArrayClear
8 overloads
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
Clears the elements of the given array to the default value.
ArrayCopy
8 overloads
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
Copies elements from one array to another.
GrowCapacity
Grows the given capacity, making sure it stays within [0..2147483647] and is larger than or equal to required opt.
IsValid
Is this object valid (see remarks)?
An object is considered valid if it is in one of the following lifecycle states:
-
LifecycleState.Disposing (the IDisposable.Dispose method is being called).
An non-null object that does not implement the ILifecycleState interface is always valid. Null objects are always invalid.
MemoryConsumptionOf
10 overloads
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Returns the estimated memory consumption of the given thing.
Pin
2 overloads
Returns pin for the given object.
For each call to Pin1, the Pin2 method must be called at least once, where the last call must free the pin.
Returns the object of the given pin.
VarIntLength
Returns the number of bytes that are required to encode the given value using variable coding from one to nine bytes.
VarIntRead
2 overloads
Reads a signed 64-bit value from the IDataStream using variable coding from one to nine bytes.
The encoding is independent on byte endianness.
- IOException
-
If an I/O error has occurred.
- See also
Reads a signed 64-bit value from the ByteBuffer using variable coding from one to nine bytes.
The encoding is independent on byte endianness.
- See also
VarIntWrite
2 overloads
Writes a signed 64-bit value to the IDataStream using variable coding from one to nine bytes.
The encoding is independent on byte endianness.
- IOException
-
If an I/O error has occurred.
- See also
Writes a signed 64-bit value to the ByteBuffer using variable coding from one to nine bytes.
The encoding is independent on byte endianness.
- See also