SunSPOT API V3.0


com.sun.spot.util
Class PrettyPrint

java.lang.Object
  extended by com.sun.spot.util.PrettyPrint

public class PrettyPrint
extends Object


Constructor Summary
PrettyPrint()
           
 
Method Summary
static void main(String[] args)
           
static String prettyPrint(byte[] b)
          Converts a byte array to a pretty printed string of the kind shown below 0000 - 16 03 00 00 38 ee ba df-fa fa 64 0c 45 5e 11 e3 ....8.....d.E^.. 0010 - 5a 0f 11 33 48 23 d8 02-ad 17 9b 45 03 dd f6 7d Z..3H#.....E...} 0020 - 88 91 d4 2c e1 2e 78 da-5a 6f 2c 39 98 0e 38 d5 ...,..x.Zo,9..8. 0030 - bb 29 .)
static String prettyPrint(byte[] b, int off, int len)
          Converts a subsequence of bytes in a byte array into a pretty printed string of the kind shown below 0000 - 16 03 00 00 38 ee ba df-fa fa 64 0c 45 5e 11 e3 ....8.....d.E^.. 0010 - 5a 0f 11 33 48 23 d8 02-ad 17 9b 45 03 dd f6 7d Z..3H#.....E...} 0020 - 88 91 d4 2c e1 2e 78 da-5a 6f 2c 39 98 0e 38 d5 ...,..x.Zo,9..8. 0030 - bb 29 .)
static StringBuffer prettyPrint(StringBuffer buf, byte[] b, int off, int len)
          Appends a subsequence of bytes in a byte array into a pretty printed StringBuffer of the kind shown below 0000 - 16 03 00 00 38 ee ba df-fa fa 64 0c 45 5e 11 e3 ....8.....d.E^.. 0010 - 5a 0f 11 33 48 23 d8 02-ad 17 9b 45 03 dd f6 7d Z..3H#.....E...} 0020 - 88 91 d4 2c e1 2e 78 da-5a 6f 2c 39 98 0e 38 d5 ...,..x.Zo,9..8. 0030 - bb 29 .)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrettyPrint

public PrettyPrint()
Method Detail

prettyPrint

public static String prettyPrint(byte[] b)
Converts a byte array to a pretty printed string of the kind shown below
 0000 - 16 03 00 00 38 ee ba df-fa fa 64 0c 45 5e 11 e3   ....8.....d.E^..
 0010 - 5a 0f 11 33 48 23 d8 02-ad 17 9b 45 03 dd f6 7d   Z..3H#.....E...}
 0020 - 88 91 d4 2c e1 2e 78 da-5a 6f 2c 39 98 0e 38 d5   ...,..x.Zo,9..8.
 0030 - bb 29                                             .)              
 

Parameters:
b - byte array containing the bytes to be converted
Returns:
a pretty printed string of corresponding hexadecimal and printable ASCII values.

prettyPrint

public static String prettyPrint(byte[] b,
                                 int off,
                                 int len)
Converts a subsequence of bytes in a byte array into a pretty printed string of the kind shown below
 0000 - 16 03 00 00 38 ee ba df-fa fa 64 0c 45 5e 11 e3   ....8.....d.E^..
 0010 - 5a 0f 11 33 48 23 d8 02-ad 17 9b 45 03 dd f6 7d   Z..3H#.....E...}
 0020 - 88 91 d4 2c e1 2e 78 da-5a 6f 2c 39 98 0e 38 d5   ...,..x.Zo,9..8.
 0030 - bb 29                                             .)              
 

Parameters:
b - byte array containing the bytes to be converted
off - starting offset of the byte subsequence inside b
len - number of bytes to be converted
Returns:
a pretty printed string of corresponding hexadecimal and printable ASCII values.

prettyPrint

public static StringBuffer prettyPrint(StringBuffer buf,
                                       byte[] b,
                                       int off,
                                       int len)
Appends a subsequence of bytes in a byte array into a pretty printed StringBuffer of the kind shown below
 0000 - 16 03 00 00 38 ee ba df-fa fa 64 0c 45 5e 11 e3   ....8.....d.E^..
 0010 - 5a 0f 11 33 48 23 d8 02-ad 17 9b 45 03 dd f6 7d   Z..3H#.....E...}
 0020 - 88 91 d4 2c e1 2e 78 da-5a 6f 2c 39 98 0e 38 d5   ...,..x.Zo,9..8.
 0030 - bb 29                                             .)              
 

Parameters:
buf - StringBuffer to append the pretty printing to
b - byte array containing the bytes to be converted
off - starting offset of the byte subsequence inside b
len - number of bytes to be converted
Returns:
the StringBuffer with the appended pretty printed hexadecimal and printable ASCII values.

main

public static void main(String[] args)

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.