net.sourceforge.jpcap.util
Class AsciiHelper
java.lang.Object
net.sourceforge.jpcap.util.AsciiHelper
public class AsciiHelper
- extends Object
Functions for formatting and printing binary data as ascii.
- Version:
- $Revision: 1.1 $
- Author:
- Patrick Charles and Jonas Lehmann
- Last modified by:
- $Author: esmondpitt $
- Last modified at:
- $Date: 2008/08/21 02:59:23 $
Method Summary |
static String |
toString(byte[] bytes)
Returns a text representation of a byte array. |
static 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 |
AsciiHelper
public AsciiHelper()
toText
public static 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 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.