Package io.hyperfoil.impl
Class Util
- java.lang.Object
-
- io.hyperfoil.impl.Util
-
public class Util extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.CompletableFuture<java.lang.Void>COMPLETED_VOID_FUTURE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancompareIgnoreCase(byte b1, byte b2)static java.util.concurrent.ThreadFactorydaemonThreadFactory(java.lang.String prefix)static Benchmarkdeserialize(byte[] bytes)static java.lang.StringexplainCauses(java.lang.Throwable e)static booleanhasPrefix(io.netty.buffer.ByteBuf data, int offset, int length, byte[] prefix)static voidintAsText2byteBuf(int value, io.netty.buffer.ByteBuf buf)static booleanisAscii(io.netty.buffer.ByteBuf cs, int offset, int len)static booleanisLatin(java.lang.CharSequence cs)static booleanisParamConvertible(java.lang.Class<?> type)static longparseLong(io.netty.buffer.ByteBuf data, int offset, int length)static longparseLong(java.lang.CharSequence string)static longparseLong(java.lang.CharSequence string, int begin, int end)static longparseLong(java.lang.CharSequence string, int begin, int end, long defaultValue)static longparseToMillis(java.lang.String time)static longparseToNanos(java.lang.String time)static intpow(int base, int exp)static java.lang.StringprettyPrintData(double value)static java.lang.StringprettyPrintNanos(long timeNanos)static java.lang.StringprettyPrintNanos(long timeNanos, java.lang.String width, boolean spaceBeforeUnit)Pretty prints timestatic java.lang.StringprettyPrintNanosFixed(long timeNanos)Pretty prints timeNanos in 9 spacesstatic java.lang.StringprettyPrintObject(java.lang.Object value)static booleanregionMatches(java.lang.CharSequence a, int aoffset, java.lang.CharSequence b, int boffset, int length)static booleanregionMatchesIgnoreCase(java.lang.CharSequence a, int aoffset, java.lang.CharSequence b, int boffset, int length)static byte[]serialize(Benchmark benchmark)static booleanstartsWith(java.lang.CharSequence sequence, int offset, java.lang.CharSequence prefix)static io.netty.buffer.ByteBufstring2byteBuf(java.lang.CharSequence str, io.netty.buffer.ByteBuf buffer)static io.netty.util.AsciiStringtoAsciiString(io.netty.buffer.ByteBuf buf, int offset, int length)static byte[]toByteArray(java.io.InputStream stream)static bytetoLowerCase(byte b)static java.lang.StringtoString(io.netty.buffer.ByteBuf buf, int offset, int length)static java.lang.StringtoString(java.io.InputStream stream)static bytetoUpperCase(byte b)static voidurlEncode(java.lang.String string, io.netty.buffer.ByteBuf buf)
-
-
-
Method Detail
-
compareIgnoreCase
public static boolean compareIgnoreCase(byte b1, byte b2)
-
toLowerCase
public static byte toLowerCase(byte b)
-
toUpperCase
public static byte toUpperCase(byte b)
-
prettyPrintNanosFixed
public static java.lang.String prettyPrintNanosFixed(long timeNanos)
Pretty prints timeNanos in 9 spaces- Parameters:
timeNanos- Time in nanoseconds.- Returns:
- Formatted string.
-
prettyPrintNanos
public static java.lang.String prettyPrintNanos(long timeNanos, java.lang.String width, boolean spaceBeforeUnit)Pretty prints time- Parameters:
timeNanos- Time in nanoseconds.width- Number of characters in the number, as stringspaceBeforeUnit- Separate number and unit with a space.- Returns:
- Formatted string.
-
prettyPrintNanos
public static java.lang.String prettyPrintNanos(long timeNanos)
-
toString
public static java.lang.String toString(io.netty.buffer.ByteBuf buf, int offset, int length)
-
isLatin
public static boolean isLatin(java.lang.CharSequence cs)
-
isAscii
public static boolean isAscii(io.netty.buffer.ByteBuf cs, int offset, int len)
-
toAsciiString
public static io.netty.util.AsciiString toAsciiString(io.netty.buffer.ByteBuf buf, int offset, int length)
-
string2byteBuf
public static io.netty.buffer.ByteBuf string2byteBuf(java.lang.CharSequence str, io.netty.buffer.ByteBuf buffer)
-
explainCauses
public static java.lang.String explainCauses(java.lang.Throwable e)
-
regionMatchesIgnoreCase
public static boolean regionMatchesIgnoreCase(java.lang.CharSequence a, int aoffset, java.lang.CharSequence b, int boffset, int length)
-
regionMatches
public static boolean regionMatches(java.lang.CharSequence a, int aoffset, java.lang.CharSequence b, int boffset, int length)
-
startsWith
public static boolean startsWith(java.lang.CharSequence sequence, int offset, java.lang.CharSequence prefix)
-
pow
public static int pow(int base, int exp)
-
parseLong
public static long parseLong(io.netty.buffer.ByteBuf data, int offset, int length)
-
isParamConvertible
public static boolean isParamConvertible(java.lang.Class<?> type)
-
prettyPrintObject
public static java.lang.String prettyPrintObject(java.lang.Object value)
-
hasPrefix
public static boolean hasPrefix(io.netty.buffer.ByteBuf data, int offset, int length, byte[] prefix)
-
serialize
public static byte[] serialize(Benchmark benchmark) throws java.io.IOException
- Throws:
java.io.IOException
-
deserialize
public static Benchmark deserialize(byte[] bytes) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
toByteArray
public static byte[] toByteArray(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
toString
public static java.lang.String toString(java.io.InputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
parseLong
public static long parseLong(java.lang.CharSequence string)
-
parseLong
public static long parseLong(java.lang.CharSequence string, int begin, int end)
-
parseLong
public static long parseLong(java.lang.CharSequence string, int begin, int end, long defaultValue)
-
parseToNanos
public static long parseToNanos(java.lang.String time)
-
parseToMillis
public static long parseToMillis(java.lang.String time)
-
daemonThreadFactory
public static java.util.concurrent.ThreadFactory daemonThreadFactory(java.lang.String prefix)
-
urlEncode
public static void urlEncode(java.lang.String string, io.netty.buffer.ByteBuf buf)
-
prettyPrintData
public static java.lang.String prettyPrintData(double value)
-
intAsText2byteBuf
public static void intAsText2byteBuf(int value, io.netty.buffer.ByteBuf buf)
-
-