Table of Contents

Class Utils

Namespace
Org.Apache.Kafka.Common.Utils
Assembly
MASES.KNet.dll
public class Utils : JVMBridgeBase<Utils>, IDynamicMetaObjectProvider, IJVMBridgeCore, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeDefinition
Inheritance
JVMBridgeBase
JVMBridgeBase<Utils>
Utils
Implements
IJVMBridgeCore
IJVMBridgeBaseStatic
IJVMBridgeBase
IJVMBridgeDefinition
Inherited Members
JVMBridgeBase<Utils>.IsAssignableFrom(IJavaType)
JVMBridgeBase<Utils>.IsAssignableFrom<T>()
JVMBridgeBase<Utils>.Execute<T>(params T[])
JVMBridgeBase<Utils>.DynBridgeClazz
JVMBridgeBase<Utils>.BridgeClazz
JVMBridgeBase.RuntimeClassNameOf<T>()
JVMBridgeBase.ClassNameOf<T>()
JVMBridgeBase.ClassOf<T>()
JVMBridgeBase.WrapsDirect<TNewClass>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass, TReturn>(IJavaObject)
JVMBridgeBase.Wraps<TNewClass, TReturn, TConverter>(IJavaObject)
JVMBridgeBase.MonitorEnter()
JVMBridgeBase.MonitorExit()
JVMBridgeBase.IsInstanceOf(IJavaType)
JVMBridgeBase.IsInstanceOf<T>()
JVMBridgeBase.RuntimeIsInstanceOf<T>()
JVMBridgeBase.CastTo<TNewClass>()
JVMBridgeBase.CastDirect<TNewClass>()
JVMBridgeBase.Dispose()
JVMBridgeBase.ToString()
JVMBridgeBase.GetHashCode()
JVMBridgeBase.Notify()
JVMBridgeBase.NotifyAll()
JVMBridgeBase.Wait()
JVMBridgeBase.DynBridgeInstance
JVMBridgeBase.BridgeInstance
JVMBridgeBase.IsBridgeListener

Constructors

Utils()

Default constructor: even if the corresponding Java class does not have one, it is mandatory for JCOBridge

public Utils()

Utils(params object[])

Generic constructor: it is useful for JCOBridge when there is a derived class which needs to pass arguments to the highest JVMBridgeBase class

public Utils(params object[] args)

Parameters

args object[]

Properties

BridgeClassName

public override string BridgeClassName { get; }

Property Value

string

ContextOrKafkaClassLoader

public static ClassLoader ContextOrKafkaClassLoader { get; }

Property Value

ClassLoader

IsBridgeAbstract

public override bool IsBridgeAbstract { get; }

Property Value

bool

IsBridgeCloseable

public override bool IsBridgeCloseable { get; }

Property Value

bool

IsBridgeInterface

public override bool IsBridgeInterface { get; }

Property Value

bool

IsBridgeStatic

public override bool IsBridgeStatic { get; }

Property Value

bool

KafkaClassLoader

public static ClassLoader KafkaClassLoader { get; }

Property Value

ClassLoader

NL

public static String NL { get; }

Property Value

String

Methods

Abs(int)

public static int Abs(int arg0)

Parameters

arg0 int

int

Returns

int

int

AtomicMoveWithFallback(Path, Path)

public static void AtomicMoveWithFallback(Path arg0, Path arg1)

Parameters

arg0 Path

Path

arg1 Path

Path

Exceptions

IOException

AtomicMoveWithFallback(Path, Path, bool)

public static void AtomicMoveWithFallback(Path arg0, Path arg1, bool arg2)

Parameters

arg0 Path

Path

arg1 Path

Path

arg2 bool

bool

Exceptions

IOException

CastToStringObjectMap(Map<object, object>)

public static Map<String, object> CastToStringObjectMap(Map<object, object> arg0)

Parameters

arg0 Map<object, object>

Map

Returns

Map<String, object>

Map

CloseAll(params Closeable[])

public static void CloseAll(params Closeable[] arg0)

Parameters

arg0 Closeable[]

Closeable

Exceptions

IOException

CloseAllQuietly(AtomicReference<Throwable>, String, params AutoCloseable[])

public static void CloseAllQuietly(AtomicReference<Throwable> arg0, String arg1, params AutoCloseable[] arg2)

Parameters

arg0 AtomicReference<Throwable>

AtomicReference

arg1 String

String

arg2 AutoCloseable[]

AutoCloseable

CloseQuietly(AutoCloseable, String)

public static void CloseQuietly(AutoCloseable arg0, String arg1)

Parameters

arg0 AutoCloseable

AutoCloseable

arg1 String

String

CloseQuietly(AutoCloseable, String, AtomicReference<Throwable>)

public static void CloseQuietly(AutoCloseable arg0, String arg1, AtomicReference<Throwable> arg2)

Parameters

arg0 AutoCloseable

AutoCloseable

arg1 String

String

arg2 AtomicReference<Throwable>

AtomicReference

CopyArray(byte[])

public static byte[] CopyArray(byte[] arg0)

Parameters

arg0 byte[]

byte

Returns

byte[]

byte

CovariantCast<S, Arg0ExtendsS>(Iterator<Arg0ExtendsS>)

public static Iterator<S> CovariantCast<S, Arg0ExtendsS>(Iterator<Arg0ExtendsS> arg0) where Arg0ExtendsS : S

Parameters

arg0 Iterator<Arg0ExtendsS>

Iterator

Returns

Iterator<S>

Iterator

Type Parameters

S
Arg0ExtendsS

S

Delete(File)

public static void Delete(File arg0)

Parameters

arg0 File

File

Exceptions

IOException

Diff<E>(Supplier<Set<E>>, Set<E>, Set<E>)

public static Set<E> Diff<E>(Supplier<Set<E>> arg0, Set<E> arg1, Set<E> arg2)

Parameters

arg0 Supplier<Set<E>>

Supplier

arg1 Set<E>

Set

arg2 Set<E>

Set

Returns

Set<E>

Set

Type Parameters

E

EnsureCapacity(ByteBuffer, int)

public static ByteBuffer EnsureCapacity(ByteBuffer arg0, int arg1)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

Returns

ByteBuffer

ByteBuffer

EnsureConcreteSubclass(Class, Class)

public static void EnsureConcreteSubclass(Class arg0, Class arg1)

Parameters

arg0 Class

Class

arg1 Class

Class

EntriesToMap<K, V, M>(Supplier<M>)

public static Collector<Map.Entry<K, V>, M, M> EntriesToMap<K, V, M>(Supplier<M> arg0) where M : Map<K, V>

Parameters

arg0 Supplier<M>

Supplier

Returns

Collector<Map.Entry<K, V>, M, M>

Collector

Type Parameters

K
V
M

Map<K, V>

EntriesWithPrefix<V>(Map<String, V>, String)

public static Map<String, V> EntriesWithPrefix<V>(Map<String, V> arg0, String arg1)

Parameters

arg0 Map<String, V>

Map

arg1 String

String

Returns

Map<String, V>

Map

Type Parameters

V

EntriesWithPrefix<V>(Map<String, V>, String, bool)

public static Map<String, V> EntriesWithPrefix<V>(Map<String, V> arg0, String arg1, bool arg2)

Parameters

arg0 Map<String, V>

Map

arg1 String

String

arg2 bool

bool

Returns

Map<String, V>

Map

Type Parameters

V

EntriesWithPrefix<V>(Map<String, V>, String, bool, bool)

public static Map<String, V> EntriesWithPrefix<V>(Map<String, V> arg0, String arg1, bool arg2, bool arg3)

Parameters

arg0 Map<String, V>

Map

arg1 String

String

arg2 bool

bool

arg3 bool

bool

Returns

Map<String, V>

Map

Type Parameters

V

EnumOptions(Class)

public static String[] EnumOptions(Class arg0)

Parameters

arg0 Class

Class

Returns

String[]

String

FilterMap<K, V>(Map<K, V>, Predicate<Entry<K, V>>)

public static Map<K, V> FilterMap<K, V>(Map<K, V> arg0, Predicate<Map.Entry<K, V>> arg1)

Parameters

arg0 Map<K, V>

Map

arg1 Predicate<Map.Entry<K, V>>

Predicate

Returns

Map<K, V>

Map

Type Parameters

K
V

FlushDir(Path)

public static void FlushDir(Path arg0)

Parameters

arg0 Path

Path

Exceptions

IOException

FlushDirIfExists(Path)

public static void FlushDirIfExists(Path arg0)

Parameters

arg0 Path

Path

Exceptions

IOException

FlushFileIfExists(Path)

public static void FlushFileIfExists(Path arg0)

Parameters

arg0 Path

Path

Exceptions

IOException

FormatAddress(String, Integer)

public static String FormatAddress(String arg0, Integer arg1)

Parameters

arg0 String

String

arg1 Integer

Integer

Returns

String

String

FormatBytes(long)

public static String FormatBytes(long arg0)

Parameters

arg0 long

long

Returns

String

String

From32BitField(int)

public static Set<Byte> From32BitField(int arg0)

Parameters

arg0 int

int

Returns

Set<Byte>

Set

GetDateTime(String)

public static long GetDateTime(String arg0)

Parameters

arg0 String

String

Returns

long

long

Exceptions

ParseException
IllegalArgumentException

GetHost(String)

public static String GetHost(String arg0)

Parameters

arg0 String

String

Returns

String

String

GetNullableArray(ByteBuffer, int)

public static byte[] GetNullableArray(ByteBuffer arg0, int arg1)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

Returns

byte[]

byte

GetNullableSizePrefixedArray(ByteBuffer)

public static byte[] GetNullableSizePrefixedArray(ByteBuffer arg0)

Parameters

arg0 ByteBuffer

ByteBuffer

Returns

byte[]

byte

GetPort(String)

public static Integer GetPort(String arg0)

Parameters

arg0 String

String

Returns

Integer

Integer

Intersection<E>(Supplier<Set<E>>, Set<E>, params Set<E>[])

public static Set<E> Intersection<E>(Supplier<Set<E>> arg0, Set<E> arg1, params Set<E>[] arg2)

Parameters

arg0 Supplier<Set<E>>

Supplier

arg1 Set<E>

Set

arg2 Set<E>[]

Set

Returns

Set<E>

Set

Type Parameters

E

IsBlank(String)

public static bool IsBlank(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

IsEqualConstantTime(char[], char[])

public static bool IsEqualConstantTime(char[] arg0, char[] arg1)

Parameters

arg0 char[]

char

arg1 char[]

char

Returns

bool

bool

LoadClass<ReturnExtendsT, T>(String, Class)

public static Class LoadClass<ReturnExtendsT, T>(String arg0, Class arg1) where ReturnExtendsT : T

Parameters

arg0 String

String

arg1 Class

Class

Returns

Class

Class

Type Parameters

ReturnExtendsT

T

T

Exceptions

ClassNotFoundException

LoadProps(String)

public static Properties LoadProps(String arg0)

Parameters

arg0 String

String

Returns

Properties

Properties

Exceptions

IOException

LoadProps(String, List<String>)

public static Properties LoadProps(String arg0, List<String> arg1)

Parameters

arg0 String

String

arg1 List<String>

List

Returns

Properties

Properties

Exceptions

IOException

Max(long, params long[])

public static long Max(long arg0, params long[] arg1)

Parameters

arg0 long

long

arg1 long[]

long

Returns

long

long

MaybeCloseQuietly(object, String)

public static void MaybeCloseQuietly(object arg0, String arg1)

Parameters

arg0 object

object

arg1 String

String

MergeConfigs(List<ConfigDef>)

public static ConfigDef MergeConfigs(List<ConfigDef> arg0)

Parameters

arg0 List<ConfigDef>

List

Returns

ConfigDef

ConfigDef

Min(short, short)

public static short Min(short arg0, short arg1)

Parameters

arg0 short

short

arg1 short

short

Returns

short

short

Min(long, params long[])

public static long Min(long arg0, params long[] arg1)

Parameters

arg0 long

long

arg1 long[]

long

Returns

long

long

MkEntry<K, V>(K, V)

public static Map.Entry<K, V> MkEntry<K, V>(K arg0, V arg1)

Parameters

arg0 K

K

arg1 V

V

Returns

Map.Entry<K, V>

Map.Entry

Type Parameters

K
V

MkMap<K, V>(params Entry<K, V>[])

public static Map<K, V> MkMap<K, V>(params Map.Entry<K, V>[] arg0)

Parameters

arg0 Entry<K, V>[]

Map.Entry

Returns

Map<K, V>

Map

Type Parameters

K
V

MkObjectProperties(Map<String, object>)

public static Properties MkObjectProperties(Map<String, object> arg0)

Parameters

arg0 Map<String, object>

Map

Returns

Properties

Properties

MkProperties(Map<String, String>)

public static Properties MkProperties(Map<String, String> arg0)

Parameters

arg0 Map<String, String>

Map

Returns

Properties

Properties

MkSet<T>(params T[])

public static Set<T> MkSet<T>(params T[] arg0)

Parameters

arg0 T[]

T

Returns

Set<T>

Set

Type Parameters

T

MkSortedSet<T>(params T[])

public static SortedSet<T> MkSortedSet<T>(params T[] arg0) where T : Comparable<T>

Parameters

arg0 T[]

T

Returns

SortedSet<T>

SortedSet

Type Parameters

T

Comparable<T>

MkString<K, V>(Map<K, V>, String, String, String, String)

public static String MkString<K, V>(Map<K, V> arg0, String arg1, String arg2, String arg3, String arg4)

Parameters

arg0 Map<K, V>

Map

arg1 String

String

arg2 String

String

arg3 String

String

arg4 String

String

Returns

String

String

Type Parameters

K
V

Murmur2(byte[])

public static int Murmur2(byte[] arg0)

Parameters

arg0 byte[]

byte

Returns

int

int

NewInstance<T>(Class)

public static T NewInstance<T>(Class arg0)

Parameters

arg0 Class

Class

Returns

T

T

Type Parameters

T

NewInstance<T>(Class, Class)

public static T NewInstance<T>(Class arg0, Class arg1)

Parameters

arg0 Class

Class

arg1 Class

Class

Returns

T

T

Type Parameters

T

NewInstance<T>(String, Class)

public static T NewInstance<T>(String arg0, Class arg1)

Parameters

arg0 String

String

arg1 Class

Class

Returns

T

T

Type Parameters

T

Exceptions

ClassNotFoundException

NewParameterizedInstance<T>(String, params object[])

public static T NewParameterizedInstance<T>(String arg0, params object[] arg1)

Parameters

arg0 String

String

arg1 object[]

object

Returns

T

T

Type Parameters

T

Exceptions

ClassNotFoundException

ParseMap(String, String, String)

public static Map<String, String> ParseMap(String arg0, String arg1, String arg2)

Parameters

arg0 String

String

arg1 String

String

arg2 String

String

Returns

Map<String, String>

Map

PropsToMap(Properties)

public static Map<String, object> PropsToMap(Properties arg0)

Parameters

arg0 Properties

Properties

Returns

Map<String, object>

Map

PropsToStringMap(Properties)

public static Map<String, String> PropsToStringMap(Properties arg0)

Parameters

arg0 Properties

Properties

Returns

Map<String, String>

Map

ReadBytes(ByteBuffer)

public static byte[] ReadBytes(ByteBuffer arg0)

Parameters

arg0 ByteBuffer

ByteBuffer

Returns

byte[]

byte

ReadBytes(ByteBuffer, int)

public static ByteBuffer ReadBytes(ByteBuffer arg0, int arg1)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

Returns

ByteBuffer

ByteBuffer

ReadBytes(ByteBuffer, int, int)

public static byte[] ReadBytes(ByteBuffer arg0, int arg1, int arg2)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

arg2 int

int

Returns

byte[]

byte

ReadFileAsString(String)

public static String ReadFileAsString(String arg0)

Parameters

arg0 String

String

Returns

String

String

Exceptions

IOException

ReadFully(InputStream, ByteBuffer)

public static int ReadFully(InputStream arg0, ByteBuffer arg1)

Parameters

arg0 InputStream

InputStream

arg1 ByteBuffer

ByteBuffer

Returns

int

int

Exceptions

IOException

ReadFully(FileChannel, ByteBuffer, long)

public static void ReadFully(FileChannel arg0, ByteBuffer arg1, long arg2)

Parameters

arg0 FileChannel

FileChannel

arg1 ByteBuffer

ByteBuffer

arg2 long

long

Exceptions

IOException

ReadFullyOrFail(FileChannel, ByteBuffer, long, String)

public static void ReadFullyOrFail(FileChannel arg0, ByteBuffer arg1, long arg2, String arg3)

Parameters

arg0 FileChannel

FileChannel

arg1 ByteBuffer

ByteBuffer

arg2 long

long

arg3 String

String

Exceptions

IOException

ReplaceSuffix(String, String, String)

public static String ReplaceSuffix(String arg0, String arg1, String arg2)

Parameters

arg0 String

String

arg1 String

String

arg2 String

String

Returns

String

String

Require(bool)

public static void Require(bool arg0)

Parameters

arg0 bool

bool

Require(bool, String)

public static void Require(bool arg0, String arg1)

Parameters

arg0 bool

bool

arg1 String

String

Safe<T>(List<T>)

public static List<T> Safe<T>(List<T> arg0)

Parameters

arg0 List<T>

List

Returns

List<T>

List

Type Parameters

T

SizeDelimited(ByteBuffer, int)

public static ByteBuffer SizeDelimited(ByteBuffer arg0, int arg1)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

Returns

ByteBuffer

ByteBuffer

Sleep(long)

public static void Sleep(long arg0)

Parameters

arg0 long

long

Sorted<T>(Collection<T>)

public static List<T> Sorted<T>(Collection<T> arg0)

Parameters

arg0 Collection<T>

Collection

Returns

List<T>

List

Type Parameters

T

StackTrace(JVMBridgeException)

public static String StackTrace(JVMBridgeException arg0)

Parameters

arg0 JVMBridgeException

Throwable

Returns

String

String

To32BitField(Set<Byte>)

public static int To32BitField(Set<Byte> arg0)

Parameters

arg0 Set<Byte>

Set

Returns

int

int

ToArray(ByteBuffer)

public static byte[] ToArray(ByteBuffer arg0)

Parameters

arg0 ByteBuffer

ByteBuffer

Returns

byte[]

byte

ToArray(ByteBuffer, int)

public static byte[] ToArray(ByteBuffer arg0, int arg1)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

Returns

byte[]

byte

ToArray(ByteBuffer, int, int)

public static byte[] ToArray(ByteBuffer arg0, int arg1, int arg2)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

arg2 int

int

Returns

byte[]

byte

ToList<T>(Iterable<T>)

public static List<T> ToList<T>(Iterable<T> arg0)

Parameters

arg0 Iterable<T>

Iterable

Returns

List<T>

List

Type Parameters

T

ToList<T>(Iterator<T>)

public static List<T> ToList<T>(Iterator<T> arg0)

Parameters

arg0 Iterator<T>

Iterator

Returns

List<T>

List

Type Parameters

T

ToList<T>(Iterator<T>, Predicate<T>)

public static List<T> ToList<T>(Iterator<T> arg0, Predicate<T> arg1)

Parameters

arg0 Iterator<T>

Iterator

arg1 Predicate<T>

Predicate

Returns

List<T>

List

Type Parameters

T

ToLogDateTimeFormat(long)

public static String ToLogDateTimeFormat(long arg0)

Parameters

arg0 long

long

Returns

String

String

ToNullableArray(ByteBuffer)

public static byte[] ToNullableArray(ByteBuffer arg0)

Parameters

arg0 ByteBuffer

ByteBuffer

Returns

byte[]

byte

ToPositive(int)

public static int ToPositive(int arg0)

Parameters

arg0 int

int

Returns

int

int

TryAll(List<Callable<Void>>)

public static void TryAll(List<Callable<Void>> arg0)

Parameters

arg0 List<Callable<Void>>

List

Exceptions

Throwable

Union<E>(Supplier<Set<E>>, params Set<E>[])

public static Set<E> Union<E>(Supplier<Set<E>> arg0, params Set<E>[] arg1)

Parameters

arg0 Supplier<Set<E>>

Supplier

arg1 Set<E>[]

Set

Returns

Set<E>

Set

Type Parameters

E

Utf8(String)

public static byte[] Utf8(String arg0)

Parameters

arg0 String

String

Returns

byte[]

byte

Utf8(ByteBuffer)

public static String Utf8(ByteBuffer arg0)

Parameters

arg0 ByteBuffer

ByteBuffer

Returns

String

String

Utf8(ByteBuffer, int)

public static String Utf8(ByteBuffer arg0, int arg1)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

Returns

String

String

Utf8(ByteBuffer, int, int)

public static String Utf8(ByteBuffer arg0, int arg1, int arg2)

Parameters

arg0 ByteBuffer

ByteBuffer

arg1 int

int

arg2 int

int

Returns

String

String

Utf8(byte[])

public static String Utf8(byte[] arg0)

Parameters

arg0 byte[]

byte

Returns

String

String

Utf8Length(CharSequence)

public static int Utf8Length(CharSequence arg0)

Parameters

arg0 CharSequence

CharSequence

Returns

int

int

ValidHostPattern(String)

public static bool ValidHostPattern(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

WrapNullable(byte[])

public static ByteBuffer WrapNullable(byte[] arg0)

Parameters

arg0 byte[]

byte

Returns

ByteBuffer

ByteBuffer

WriteFully(FileChannel, ByteBuffer)

public static void WriteFully(FileChannel arg0, ByteBuffer arg1)

Parameters

arg0 FileChannel

FileChannel

arg1 ByteBuffer

ByteBuffer

Exceptions

IOException

WriteTo(DataOutput, ByteBuffer, int)

public static void WriteTo(DataOutput arg0, ByteBuffer arg1, int arg2)

Parameters

arg0 DataOutput

DataOutput

arg1 ByteBuffer

ByteBuffer

arg2 int

int

Exceptions

IOException