com.sun.mail.util
Class ASCIIUtility

java.lang.Object
  extended by com.sun.mail.util.ASCIIUtility

public class ASCIIUtility
extends java.lang.Object


Method Summary
static byte[] getBytes(java.io.InputStream is)
           
static byte[] getBytes(java.lang.String s)
           
static int parseInt(byte[] b, int start, int end)
          Convert the bytes within the specified range of the given byte array into a signed integer .
static int parseInt(byte[] b, int start, int end, int radix)
          Convert the bytes within the specified range of the given byte array into a signed integer in the given radix .
static long parseLong(byte[] b, int start, int end)
          Convert the bytes within the specified range of the given byte array into a signed long .
static long parseLong(byte[] b, int start, int end, int radix)
          Convert the bytes within the specified range of the given byte array into a signed long in the given radix .
static java.lang.String toString(byte[] b, int start, int end)
          Convert the bytes within the specified range of the given byte array into a String.
static java.lang.String toString(java.io.ByteArrayInputStream is)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseInt

public static int parseInt(byte[] b,
                           int start,
                           int end,
                           int radix)
                    throws java.lang.NumberFormatException
Convert the bytes within the specified range of the given byte array into a signed integer in the given radix . The range extends from start till, but not including end.

Based on java.lang.Integer.parseInt()

Throws:
java.lang.NumberFormatException

parseInt

public static int parseInt(byte[] b,
                           int start,
                           int end)
                    throws java.lang.NumberFormatException
Convert the bytes within the specified range of the given byte array into a signed integer . The range extends from start till, but not including end.

Throws:
java.lang.NumberFormatException

parseLong

public static long parseLong(byte[] b,
                             int start,
                             int end,
                             int radix)
                      throws java.lang.NumberFormatException
Convert the bytes within the specified range of the given byte array into a signed long in the given radix . The range extends from start till, but not including end.

Based on java.lang.Long.parseLong()

Throws:
java.lang.NumberFormatException

parseLong

public static long parseLong(byte[] b,
                             int start,
                             int end)
                      throws java.lang.NumberFormatException
Convert the bytes within the specified range of the given byte array into a signed long . The range extends from start till, but not including end.

Throws:
java.lang.NumberFormatException

toString

public static java.lang.String toString(byte[] b,
                                        int start,
                                        int end)
Convert the bytes within the specified range of the given byte array into a String. The range extends from start till, but not including end.


toString

public static java.lang.String toString(java.io.ByteArrayInputStream is)

getBytes

public static byte[] getBytes(java.lang.String s)

getBytes

public static byte[] getBytes(java.io.InputStream is)
                       throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2011. All Rights Reserved.