com.googlecode.fascinator.common
Class Utf8StringDebug

java.lang.Object
  extended by com.googlecode.fascinator.common.Utf8StringDebug

public class Utf8StringDebug
extends Object

A class purely for debugging UTF-8 Strings.

Author:
Greg Pendlebury

Constructor Summary
Utf8StringDebug()
           
 
Method Summary
static String byteToHex(byte b)
          Convert byte to hex
static void debugString(String newString)
          Simple entry point, Looks for only multi-byte characters
static void debugString(String newString, int limit)
          Optional 'limit' can be set to 0 to show all characters
static String displayString(String newString, int limit)
          Used recursively to pull the string apart
static String printBytes(byte[] array, String name, int limit)
          Print the bytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utf8StringDebug

public Utf8StringDebug()
Method Detail

debugString

public static void debugString(String newString)
Simple entry point, Looks for only multi-byte characters

Parameters:
newString - String to be debugged

debugString

public static void debugString(String newString,
                               int limit)
Optional 'limit' can be set to 0 to show all characters

Parameters:
newString - String to be debugged
limit - number of characters to be printed

displayString

public static String displayString(String newString,
                                   int limit)
Used recursively to pull the string apart

Parameters:
newString - String to be debugged
limit - number of characters to be printed

printBytes

public static String printBytes(byte[] array,
                                String name,
                                int limit)
Print the bytes

Parameters:
array - byte
name -
limit - number of characters to be printed
Returns:

byteToHex

public static String byteToHex(byte b)
Convert byte to hex

Parameters:
b - in byte
Returns:
converted String


Copyright © 2009-2013. All Rights Reserved.