Package org.mariadb.r2dbc.util
Class LoggerHelper
- java.lang.Object
-
- org.mariadb.r2dbc.util.LoggerHelper
-
public final class LoggerHelper extends Object
Logger helper to display network exchange
-
-
Constructor Summary
Constructors Constructor Description LoggerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringhex(byte[] header, byte[] bytes, int offset, int dataLength, int trunkLength)return a string containing hexa displayable value of arraysstatic Stringhex(byte[] bytes, int offset, int dataLength)Write bytes/hexadecimal value of a byte array to a StringBuilder.static Stringhex(byte[] bytes, int offset, int dataLength, int trunkLength)Transform bytes into readable string format
-
-
-
Method Detail
-
hex
public static String hex(byte[] bytes, int offset, int dataLength)
Write bytes/hexadecimal value of a byte array to a StringBuilder.String output example :
+--------------------------------------------------+ | 0 1 2 3 4 5 6 7 8 9 a b c d e f | +--------------------------------------------------+------------------+ | 5F 00 00 00 03 73 65 74 20 61 75 74 6F 63 6F 6D | _....set autocom | | 6D 69 74 3D 31 2C 20 73 65 73 73 69 6F 6E 5F 74 | mit=1, session_t | | 72 61 63 6B 5F 73 63 68 65 6D 61 3D 31 2C 20 73 | rack_schema=1, s | | 71 6C 5F 6D 6F 64 65 20 3D 20 63 6F 6E 63 61 74 | ql_mode = concat | | 28 40 40 73 71 6C 5F 6D 6F 64 65 2C 27 2C 53 54 | (@@sql_mode,',ST | | 52 49 43 54 5F 54 52 41 4E 53 5F 54 41 42 4C 45 | RICT_TRANS_TABLE | | 53 27 29 | S') | +--------------------------------------------------+------------------+- Parameters:
bytes- byte arrayoffset- offsetdataLength- byte length to write- Returns:
- formated hexa
-
hex
public static String hex(byte[] bytes, int offset, int dataLength, int trunkLength)
Transform bytes into readable string format- Parameters:
bytes- bytesoffset- offsetdataLength- data lengthtrunkLength- truncation limit- Returns:
- readable string format
-
hex
public static String hex(byte[] header, byte[] bytes, int offset, int dataLength, int trunkLength)
return a string containing hexa displayable value of arrays- Parameters:
header- header arraybytes- data contentoffset- data offsetdataLength- data lengthtrunkLength- data limit- Returns:
- displayable value of arrays
-
-