Package com.wowza.util
Class DebugUtils
- Object
- 
- com.wowza.util.DebugUtils
 
- 
 public final class DebugUtils extends ObjectDebugUtils: Debugging utilties. 
- 
- 
Constructor SummaryConstructors Constructor Description DebugUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.FilebyteArrayToFile(byte[] data, String filePath)Dump a buffer of bytes to a file.static booleandoesStackContainMethod(String methodName)Examine current stack trace to determine if the specified method name in the the trace.static StringformatBytes(byte[] data)Format byte array for printing.static StringformatBytes(byte[] data, boolean showIndex)Format byte array for printing.static StringformatBytes(byte[] data, int offset, int len)Format byte array for printing.static StringformatBytes(byte[] data, int offset, int len, boolean showIndex)Format byte array for printing.static StringformatBytesInSingleRow(byte[] data, int offset, int len)Format byte array for printing.static StringformatBytesShort(byte[] data)Format byte array for printing.static StringformatBytesShort(byte[] data, int offset, int len)Format byte array for printing.static StringformatBytesStruct(byte[] data)static StringformatBytesStruct(byte[] data, int offset, int len)Format byte array for printing.static StringformatMilliseconds(long ms)Give a time in seconds, return a String representing the time in hh:mm:ss.mmm.static StringformatSeconds(long t)Give a time in seconds, return a String representing the time in hh:mm:ss.static StringformatUtcTime(long utcTime)static StringstackTraceToSingleLineString(Throwable e, int maxLines)Given an exception, return single line String representation.static StringstackTraceToString(Throwable e)Given an exception, return String representation.static StringstackTraceToString(Throwable e, int maxLines, String seperator)Given an exception, return single line String representation.static StringtoHex(byte value)Format a byte value to a 0xff formatstatic StringtoHex(int value)Format a byte value to a 0xffffffff formatstatic StringtoLong(long value)Format a long value to a 0xffffffffffffffff format
 
- 
- 
- 
Method Detail- 
formatBytesShortpublic static String formatBytesShort(byte[] data) Format byte array for printing. Simple format as rows of hex values (16 values per row)- Parameters:
- data- byte array
- Returns:
- formatted string
 
 - 
formatBytesShortpublic static String formatBytesShort(byte[] data, int offset, int len)Format byte array for printing. Simple format as rows of hex values (16 values per row)- Parameters:
- data- byte array
- offset- offset in array
- len- data len
- Returns:
- formatted string
 
 - 
formatBytespublic static String formatBytes(byte[] data) Format byte array for printing. Format as rows of hex values (16 values per row) along with text representation of data.- Parameters:
- data- byte array
- Returns:
- formatted string
 
 - 
formatBytespublic static String formatBytes(byte[] data, boolean showIndex)Format byte array for printing. Format as rows of hex values (16 values per row) along with text representation of data.- Parameters:
- data- byte array
- Returns:
- formatted string
 
 - 
formatBytespublic static String formatBytes(byte[] data, int offset, int len)Format byte array for printing. Format as rows of hex values (16 values per row) along with text representation of data.- Parameters:
- data- byte array
- offset- start index in array
- len- length to format
- Returns:
- formatted string
 
 - 
formatBytespublic static String formatBytes(byte[] data, int offset, int len, boolean showIndex)Format byte array for printing. Format as rows of hex values (16 values per row) along with text representation of data.- Parameters:
- data- byte array
- offset- start index in array
- len- length to format
- Returns:
- formatted string
 
 - 
formatBytesInSingleRowpublic static String formatBytesInSingleRow(byte[] data, int offset, int len)Format byte array for printing. Format as rows of hex values al in one row along with text representation of data.- Parameters:
- data- byte array
- offset- start index in array
- len- length to format
- Returns:
- formatted string
 
 - 
formatBytesStructpublic static String formatBytesStruct(byte[] data) 
 - 
formatBytesStructpublic static String formatBytesStruct(byte[] data, int offset, int len)Format byte array for printing. Format as Java primitive byte values (8 per row).- Parameters:
- data- byte array
- Returns:
- formatted string
 
 - 
toHexpublic static String toHex(byte value) Format a byte value to a 0xff format- Parameters:
- value- byte value
- Returns:
- return string
 
 - 
toHexpublic static String toHex(int value) Format a byte value to a 0xffffffff format- Parameters:
- value- int value
- Returns:
- return string
 
 - 
toLongpublic static String toLong(long value) Format a long value to a 0xffffffffffffffff format- Parameters:
- value- long value
- Returns:
- return string
 
 - 
byteArrayToFilepublic static java.io.File byteArrayToFile(byte[] data, String filePath)Dump a buffer of bytes to a file. Useful for debugging.- Parameters:
- data- a buffer of bytes
- filePath- The path and filename
 
 - 
formatSecondspublic static String formatSeconds(long t) Give a time in seconds, return a String representing the time in hh:mm:ss.123 s --> 00:02:03 - Parameters:
- t-
- Returns:
- time representation
 
 - 
formatMillisecondspublic static String formatMilliseconds(long ms) Give a time in seconds, return a String representing the time in hh:mm:ss.mmm.123456 ms --> 00:02:03.456 - Parameters:
- ms-
- Returns:
- time representation
 
 - 
formatUtcTimepublic static String formatUtcTime(long utcTime) 
 - 
stackTraceToStringpublic static String stackTraceToString(Throwable e) Given an exception, return String representation. Note: this is the entire raw stack trace including tabs and line endings- Parameters:
- e- throwable
- Returns:
- stack trace representation
 
 - 
stackTraceToSingleLineStringpublic static String stackTraceToSingleLineString(Throwable e, int maxLines)Given an exception, return single line String representation. Note: line endings are replaced with "|" character. Tabs are removed.- Parameters:
- e- throwable
- maxLines- If greater than zero, returns only first maxLines of trace
- Returns:
- stack trace info
 
 - 
stackTraceToStringpublic static String stackTraceToString(Throwable e, int maxLines, String seperator)Given an exception, return single line String representation. Note: line endings are replaced with "|" character. Tabs are removed.- Parameters:
- e- throwable
- maxLines- If greater than zero, returns only first maxLines of trace
- seperator- character to replace line endings with
- Returns:
- stack trace info
 
 - 
doesStackContainMethodpublic static boolean doesStackContainMethod(String methodName) Examine current stack trace to determine if the specified method name in the the trace.Could be enhanced quite a bit by also checking for Class and method. But simple for now. - Parameters:
- methodName-
- Returns:
- true if in trace, else false
 
 
- 
 
-