Package co.elastic.apm.agent.util
Class HexUtils
- java.lang.Object
-
- co.elastic.apm.agent.util.HexUtils
-
public class HexUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbytesToHex(byte[] bytes)Converts a byte array to a hex encoded (aka base 16 encoded) stringstatic voiddecode(java.lang.String hexEncodedString, int srcOffset, int srcLength, byte[] bytes, int destOffset)static bytegetNextByte(java.lang.String hexEncodedString, int offset)static voidnextBytes(java.lang.String hexEncodedString, int offset, byte[] bytes)static voidwriteAsHex(long l, com.dslplatform.json.JsonWriter jw)static voidwriteByteAsHex(byte b, java.lang.StringBuilder sb)static voidwriteBytesAsHex(byte[] bytes, int offset, int length, java.lang.StringBuilder sb)static voidwriteBytesAsHex(byte[] bytes, com.dslplatform.json.JsonWriter jw)static voidwriteBytesAsHex(byte[] bytes, java.lang.StringBuilder sb)
-
-
-
Method Detail
-
bytesToHex
public static java.lang.String bytesToHex(byte[] bytes)
Converts a byte array to a hex encoded (aka base 16 encoded) stringFrom https://stackoverflow.com/a/9855338
- Parameters:
bytes- The input byte array.- Returns:
- A hex encoded string representation of the byte array.
-
writeBytesAsHex
public static void writeBytesAsHex(byte[] bytes, com.dslplatform.json.JsonWriter jw)
-
writeBytesAsHex
public static void writeBytesAsHex(byte[] bytes, java.lang.StringBuilder sb)
-
writeBytesAsHex
public static void writeBytesAsHex(byte[] bytes, int offset, int length, java.lang.StringBuilder sb)
-
writeByteAsHex
public static void writeByteAsHex(byte b, java.lang.StringBuilder sb)
-
getNextByte
public static byte getNextByte(java.lang.String hexEncodedString, int offset)
-
nextBytes
public static void nextBytes(java.lang.String hexEncodedString, int offset, byte[] bytes)
-
decode
public static void decode(java.lang.String hexEncodedString, int srcOffset, int srcLength, byte[] bytes, int destOffset)
-
writeAsHex
public static void writeAsHex(long l, com.dslplatform.json.JsonWriter jw)
-
-