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

		if (markers == null) {
			return hexLineData(data, offset);
		}

		final StringBuilder b = new StringBuilder();

		final String m[] = {
				"*",
				"*"
		};

		int marker = findMarker(markers, offset);
		int start = markers[marker][0];
		int end = start + markers[marker][1] - 1;

		int i = 0;
		for (i = 0; i + offset < data.length && i < 16; i++) {
			final int o = i + offset;
			if (o == 0 && o == start) {
				b.append(m[marker % 2]);
			} else if (i == 0) {
				b.append(SPACE_CHAR);
			}

			/**
			 * Insert a space every 4 characaters.
			 */
			if (i % 4 == 0 && i != 0)
				b.append(SPACE_CHAR);

			if (o == end) {
				marker = findMarker(markers, o + 1);
				start = markers[marker][0];
				end = start + markers[marker][1] - 1;

				b.append(toHexString(data[o])).append(m[marker % 2]);

			} else {
				b.append(toHexString(data[o])).append(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)
				b.append(SPACE_CHAR);

			b.append(SPACE_CHAR).append(SPACE_CHAR).append(SPACE_CHAR);
		}

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

@param data
data array
@param offset
offset into the array
@param markers
the markers
@return formatted string
Formats the data array as a hexdump . @param data data array @param offset offset into the array @param markers the markers @return formatted string
public static String hexLineData(byte[] data, int offset, int[][] markers) {
		if (markers == null) {
			return hexLineData(data, offset);
		}
		final StringBuilder b = new StringBuilder();
		final String m[] = {
				"*",
				"*"
		};
		int marker = findMarker(markers, offset);
		int start = markers[marker][0];
		int end = start + markers[marker][1] - 1;
		int i = 0;
		for (i = 0; i + offset < data.length && i < 16; i++) {
			final int o = i + offset;
			if (o == 0 && o == start) {
				b.append(m[marker % 2]);
			} else if (i == 0) {
				b.append(SPACE_CHAR);
			}
			/**
			 * Insert a space every 4 characaters.
			 */
			if (i % 4 == 0 && i != 0)
				b.append(SPACE_CHAR);
			if (o == end) {
				marker = findMarker(markers, o + 1);
				start = markers[marker][0];
				end = start + markers[marker][1] - 1;
				b.append(toHexString(data[o])).append(m[marker % 2]);
			} else {
				b.append(toHexString(data[o])).append(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)
				b.append(SPACE_CHAR);
			b.append(SPACE_CHAR).append(SPACE_CHAR).append(SPACE_CHAR);
		}
		return b.toString();
	}
public static String hexLineData ( byte [ ] data , int offset , int [ ] [ ] markers ) { if ( markers == null ) { return hexLineData ( data , offset ) ; } final StringBuilder b = new StringBuilder ( ) ; final String m [ ] = { "*" , "*" } ; int marker = findMarker ( markers , offset ) ; int start = markers [ marker ] [ 0 ] ; int end = start + markers [ marker ] [ 1 ] - 1 ; int i = 0 ; for ( i = 0 ; i + offset < data . length && i < 16 ; i ++ ) { final int o = i + offset ; if ( o == 0 && o == start ) { b . append ( m [ marker % 2 ] ) ; } else if ( i == 0 ) { b . append ( SPACE_CHAR ) ; } /**
			 * Insert a space every 4 characaters.
			 */ if ( i % 4 == 0 && i != 0 ) b . append ( SPACE_CHAR ) ; if ( o == end ) { marker = findMarker ( markers , o + 1 ) ; start = markers [ marker ] [ 0 ] ; end = start + markers [ marker ] [ 1 ] - 1 ; b . append ( toHexString ( data [ o ] ) ) . append ( m [ marker % 2 ] ) ; } else { b . append ( toHexString ( data [ o ] ) ) . append ( 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 ) b . append ( SPACE_CHAR ) ; b . append ( SPACE_CHAR ) . append ( SPACE_CHAR ) . append ( SPACE_CHAR ) ; } return b . toString ( ) ; }
Formats the data array as a hexdump.
Formats the data array as a hexdump .