net.sourceforge.jpcap.util
Class AsciiHelper

java.lang.Object
  extended bynet.sourceforge.jpcap.util.AsciiHelper

public class AsciiHelper
extends java.lang.Object

Functions for formatting and printing binary data as ascii.


Constructor Summary
AsciiHelper()
           
 
Method Summary
static java.lang.String toString(byte[] bytes)
          Returns a text representation of a byte array.
static java.lang.String toText(byte[] bytes)
          Returns a text representation of a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiHelper

public AsciiHelper()
Method Detail

toText

public static java.lang.String toText(byte[] bytes)
Returns a text representation of a byte array. Bytes in the array which don't convert to text in the range a..Z are dropped.

Parameters:
bytes - a byte array
Returns:
a string containing the text equivalent of the bytes.

toString

public static java.lang.String toString(byte[] bytes)
Returns a text representation of a byte array. Bytes in the array which don't convert to printable ascii characters are dropped.

Parameters:
bytes - a byte array
Returns:
a string containing the ascii equivalent of the bytes.