Package com.iizix.server
Class BinaryTrace
java.lang.Object
com.iizix.server.BinaryTrace
This class is used to trace binary data to an output stream.
- Author:
- Christopher Mindus
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- static void- dump- (SessionInfo si, byte[] buf) - static void- dump- (SessionInfo si, byte[] buf, boolean isEBCDIC) - static void- dump- (SessionInfo si, byte[] buf, int length) - static void- dump- (SessionInfo si, byte[] buf, int length, boolean isEBCDIC) - static void- dump- (SessionInfo si, byte[] buf, int startingPosition, int length) - static void- dump- (SessionInfo si, byte[] buf, int startingPosition, int length, boolean isEBCDIC) - static void- dump- (SessionInfo si, String header) - static void- dump- (SessionInfo si, String[] headers) - static void- dump- (SessionInfo si, String header, byte[] buf) - static void- dump- (SessionInfo si, String header, byte[] buf, boolean isEBCDIC) - static void- dump- (SessionInfo si, String header, byte[] buf, int length) - static void- dump- (SessionInfo si, String header, byte[] buf, int length, boolean isEBCDIC) - static void- dump- (SessionInfo si, String header, byte[] buf, int startingPosition, int length) - static void- dump- (SessionInfo si, String header, byte[] buf, int startingPosition, int length, boolean isEBCDIC) - static void- dump- (SessionInfo si, String mainHeading, String[] headers) - static voidPrints a line of text to stderr even if redirection is present.- static void- errPrintln- (String text) Prints a line of text to stderr even if redirection is present.- static longGets the maximum file size of a trace file.- static String- getThousandFormattedNumber- (int nn) Gets a thousand-formatted positive number.- static String- getThousandFormattedNumber- (long nn) Gets a thousand-formatted positive number.- static longGets the current trace file length.- static StringThe current trace file name.- static voidPrints a line of text to the screen even if redirection is present.- static voidPrints a line of text to the screen even if redirection is present.- static booleanChanges the trace files.- static boolean- setMaximumFileSize- (long size) Sets the maximum file size of a trace file.- static void- setScreenOutputRedirection- (boolean redirect) Redirects stdout and stderr to trace file, or restores the original settings.- static voidSets the trace file name.- static void- setTraceFileName- (String fn, boolean doAppend) Sets the trace file name.- static void- setupTraceFileNames- (String fn1, String fn2) Sets up the two file names used when rotating trace files.
- Constructor Details- BinaryTracepublic BinaryTrace()
 
- Method Details- dumppublic static void dump- (SessionInfo si, String header, byte[] buf, int startingPosition, int length, boolean isEBCDIC) 
- dumppublic static void dump- (SessionInfo si, byte[] buf, int startingPosition, int length, boolean isEBCDIC) 
- dump
- dump
- dump
- dump
- dumppublic static void dump- (SessionInfo si, String header, byte[] buf, int startingPosition, int length) 
- dump
- dump
- dump
- dump
- dump
- dump
- dump
- dump
- setupTraceFileNamesSets up the two file names used when rotating trace files. Note that this method doesn't check if the file names are identical, it is assumed that they aren't.- Note: No assignment of file name for tracing is done at this point, call - setTraceFileNamein order to perform this.
- setTraceFileNameSets the trace file name. If file name is null, the standard output System.out will be used.- Throws:
- IOException- if an I/O error occurs.
 
- setTraceFileNameSets the trace file name. If file name is null, the standard output System.out will be used.- Throws:
- IOException- if an I/O error occurs.
 
- getTraceFileNameThe current trace file name.- Returns:
- null if no trace file has been set.
 
- getTraceFileLengthpublic static long getTraceFileLength()Gets the current trace file length.- Returns:
- -1 if no file is used.
 
- rotateTraceFilespublic static boolean rotateTraceFiles()Changes the trace files.- Returns:
- false for failure, true for success.
 
- setMaximumFileSizepublic static boolean setMaximumFileSize- (long size) Sets the maximum file size of a trace file. If set to zero, no limit is used.- Returns:
- true successful, false for invalid size (100 KB minimum [102400]).
 
- getMaximumFileSizepublic static long getMaximumFileSize()Gets the maximum file size of a trace file. If set to zero, no limit is used.
- getThousandFormattedNumberGets a thousand-formatted positive number.
- getThousandFormattedNumberGets a thousand-formatted positive number.
- setScreenOutputRedirectionpublic static void setScreenOutputRedirection- (boolean redirect) Redirects stdout and stderr to trace file, or restores the original settings. The output, if redirected, is placed in the trace files.
- printPrints a line of text to the screen even if redirection is present.
- printlnPrints a line of text to the screen even if redirection is present.
- errPrintPrints a line of text to stderr even if redirection is present.
- errPrintlnPrints a line of text to stderr even if redirection is present.