Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jguild.jrpm.io.datatype
Class RPMUtil  view RPMUtil download RPMUtil.java

java.lang.Object
  extended bycom.jguild.jrpm.io.datatype.RPMUtil

public class RPMUtil
extends java.lang.Object

Misc utilities functions.

Version:
$Id: RPMUtil.java,v 1.2 2003/10/20 16:31:38 mkuss Exp $

Field Summary
private static java.lang.String DEFAULT_ENCODING
          Default encoding is US-ASCII for normal string in rpm header.
 
Constructor Summary
RPMUtil()
           
 
Method Summary
static java.lang.String byteArrayToHexString(byte[] barray)
          Method to get a beautyfied representation of an byte array as a hex string.
static java.lang.String byteToHexString(byte b)
          Method to get a beautyfied representation of a byte as a hex string.
static java.lang.String cArrayToString(byte[] data, int offset)
          Method to convert a null terminated C string into a java string using the DEFAULT_ENCODING
static java.lang.String cArrayToString(byte[] data, int offset, java.lang.String enc)
          Method to convert a null terminated C string into a java string using the defined encoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

private static final java.lang.String DEFAULT_ENCODING
Default encoding is US-ASCII for normal string in rpm header. For I18 entries the specified encoding (as defined in HEADERI18NTABLE) should be user.

See Also:
Constant Field Values
Constructor Detail

RPMUtil

public RPMUtil()
Method Detail

byteArrayToHexString

public static java.lang.String byteArrayToHexString(byte[] barray)
Method to get a beautyfied representation of an byte array as a hex string. One byte will always be displayed as two hex digits.


byteToHexString

public static java.lang.String byteToHexString(byte b)
Method to get a beautyfied representation of a byte as a hex string. The hex block will be displayed always as two digits.


cArrayToString

public static java.lang.String cArrayToString(byte[] data,
                                              int offset)
                                       throws java.io.UnsupportedEncodingException
Method to convert a null terminated C string into a java string using the DEFAULT_ENCODING


cArrayToString

public static java.lang.String cArrayToString(byte[] data,
                                              int offset,
                                              java.lang.String enc)
                                       throws java.io.UnsupportedEncodingException
Method to convert a null terminated C string into a java string using the defined encoding