org.apache.directory.shared.asn1.util
Class Asn1StringUtils

java.lang.Object
  extended by org.apache.directory.shared.asn1.util.Asn1StringUtils

public class Asn1StringUtils
extends java.lang.Object

Little helper class.

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $
Author:
Apache Directory Project

Field Summary
static byte[] EMPTY_BYTES
          The empty byte[]
 
Constructor Summary
Asn1StringUtils()
           
 
Method Summary
static byte[] asciiStringToByte(java.lang.String string)
          Thansform a string to an array of ASCII bytes, where the byte array will contain only values in [0, 127].
static java.lang.String dumpByte(byte octet)
          Helper function that dump a byte in hex form
static java.lang.String dumpBytes(byte[] buffer)
          Helper function that dump an array of bytes in hex form
static byte[] getBytesUtf8(java.lang.String string)
          Return UTF-8 encoded byte[] representation of a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_BYTES

public static final byte[] EMPTY_BYTES
The empty byte[]

Constructor Detail

Asn1StringUtils

public Asn1StringUtils()
Method Detail

dumpByte

public static java.lang.String dumpByte(byte octet)
Helper function that dump a byte in hex form

Parameters:
octet - The byte to dump
Returns:
A string representation of the byte

dumpBytes

public static java.lang.String dumpBytes(byte[] buffer)
Helper function that dump an array of bytes in hex form

Parameters:
buffer - The bytes array to dump
Returns:
A string representation of the array of bytes

getBytesUtf8

public static byte[] getBytesUtf8(java.lang.String string)
Return UTF-8 encoded byte[] representation of a String

Parameters:
string - The string to be transformed to a byte array
Returns:
The transformed byte array

asciiStringToByte

public static byte[] asciiStringToByte(java.lang.String string)
Thansform a string to an array of ASCII bytes, where the byte array will contain only values in [0, 127].

Parameters:
string - The byte array to transform
Returns:
The resulting string


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.