net.sf.beep4j.internal.util
Class ByteUtil

java.lang.Object
  extended by net.sf.beep4j.internal.util.ByteUtil

public final class ByteUtil
extends java.lang.Object

Utility class for parsing stuff.

Author:
Simon Raess

Method Summary
static java.lang.String base64Encode(byte[] data)
           
static int parseUnsignedInt(java.lang.String field, java.lang.String s)
          Parses a String field that must be in the range 0..2147483647.
static long parseUnsignedLong(java.lang.String field, java.lang.String s)
          Parses a String field that must be in the range 0..4294967295.
static byte[] toASCII(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toASCII

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

base64Encode

public static final java.lang.String base64Encode(byte[] data)

parseUnsignedInt

public static final int parseUnsignedInt(java.lang.String field,
                                         java.lang.String s)
Parses a String field that must be in the range 0..2147483647.

Parameters:
field - the name of the field
s - the String to parse
Returns:
the value returned as an int
Throws:
ProtocolException - if the parsed value does not conform to the expected format and range

parseUnsignedLong

public static final long parseUnsignedLong(java.lang.String field,
                                           java.lang.String s)
Parses a String field that must be in the range 0..4294967295.

Parameters:
field - the name of the field
s - the String to parse
Returns:
the value returned as a long
Throws:
ProtocolException - if the parsed value does not conform to the expected format and range


Copyright © 2007 null. All Rights Reserved.