src/org/jnetpcap/packet/format/FormatUtils.java
public static String hexLineData(byte[] data, int offset) {
		String s = "";

		int i = 0;
		for (i = 0; i + offset < data.length && i < 16; i++) {
			final int o = i + offset;
			if (i == 0) {
				s += SPACE_CHAR;
			}

			/**
			 * Insert a space every 4 characaters.
			 */
			if (i % 4 == 0 && i != 0) {
				s += SPACE_CHAR;
			}

			s += toHexString(data[o]) + SPACE_CHAR;

		}

		/**
		 * Continue the loop and append spaces to fill in the missing data.
		 */
		for (; i < 16; i++) {
			/**
			 * Insert a space every 4 characaters.
			 */
			if (i % 4 == 0 && i != 0)
				s += SPACE_CHAR;

			s += SPACE_CHAR + SPACE_CHAR + SPACE_CHAR;
		}

		return (s);
	}
/**
	 * Formats the data array as a hexdump.
	 * 
	 * @param data
	 *          data array
	 * @param offset
	 *          offset into the array
	 * @return formatted string
	 */
Formats the data array as a hexdump.

@param data
data array
@param offset
offset into the array
@return formatted string
Formats the data array as a hexdump . @param data data array @param offset offset into the array @return formatted string
public static String hexLineData(byte[] data, int offset) {
		String s = "";
		int i = 0;
		for (i = 0; i + offset < data.length && i < 16; i++) {
			final int o = i + offset;
			if (i == 0) {
				s += SPACE_CHAR;
			}
			/**
			 * Insert a space every 4 characaters.
			 */
			if (i % 4 == 0 && i != 0) {
				s += SPACE_CHAR;
			}
			s += toHexString(data[o]) + SPACE_CHAR;
		}
		/**
		 * Continue the loop and append spaces to fill in the missing data.
		 */
		for (; i < 16; i++) {
			/**
			 * Insert a space every 4 characaters.
			 */
			if (i % 4 == 0 && i != 0)
				s += SPACE_CHAR;
			s += SPACE_CHAR + SPACE_CHAR + SPACE_CHAR;
		}
		return (s);
	}
public static String hexLineData ( byte [ ] data , int offset ) { String s = "" ; int i = 0 ; for ( i = 0 ; i + offset < data . length && i < 16 ; i ++ ) { final int o = i + offset ; if ( i == 0 ) { s += SPACE_CHAR ; } /**
			 * Insert a space every 4 characaters.
			 */ if ( i % 4 == 0 && i != 0 ) { s += SPACE_CHAR ; } s += toHexString ( data [ o ] ) + SPACE_CHAR ; } /**
		 * Continue the loop and append spaces to fill in the missing data.
		 */ for ( ; i < 16 ; i ++ ) { /**
			 * Insert a space every 4 characaters.
			 */ if ( i % 4 == 0 && i != 0 ) s += SPACE_CHAR ; s += SPACE_CHAR + SPACE_CHAR + SPACE_CHAR ; } return ( s ) ; }
Formats the data array as a hexdump.
Formats the data array as a hexdump .