You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2003/05/02 21:22:09 UTC
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/core Msg.java
costin 2003/05/02 12:22:08
Modified: jk/java/org/apache/jk/core Msg.java
Log:
Updating my workspace. The methods are duplicated from MsgAjp - I won't remove
them from there for now ( to avoid breaking something :-). I am playing
with an MsgXdr ( won't check it in until 5.0 is released, don't worry :-)
Revision Changes Path
1.6 +30 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/Msg.java
Index: Msg.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/Msg.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Msg.java 17 Apr 2002 22:28:55 -0000 1.5
+++ Msg.java 2 May 2003 19:22:05 -0000 1.6
@@ -170,4 +170,34 @@
public abstract int getLen();
public abstract void dump(String msg);
+
+ /* -------------------- Utilities -------------------- */
+ // XXX Move to util package
+
+ public static String hexLine( byte buf[], int start, int len ) {
+ StringBuffer sb=new StringBuffer();
+ for( int i=start; i< start+16 ; i++ ) {
+ if( i < len + 4)
+ sb.append( hex( buf[i] ) + " ");
+ else
+ sb.append( " " );
+ }
+ sb.append(" | ");
+ for( int i=start; i < start+16 && i < len + 4; i++ ) {
+ if( ! Character.isISOControl( (char)buf[i] ))
+ sb.append( new Character((char)buf[i]) );
+ else
+ sb.append( "." );
+ }
+ return sb.toString();
+ }
+
+ private static String hex( int x ) {
+ // if( x < 0) x=256 + x;
+ String h=Integer.toHexString( x );
+ if( h.length() == 1 ) h = "0" + h;
+ return h.substring( h.length() - 2 );
+ }
+
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org