nanoJBlend

jp.co.aplix.extra.util
クラス HexUtil

java.lang.Object
  上位を拡張 jp.co.aplix.extra.util.HexUtil

public final class HexUtil
extends Object

HexUtil クラスはデータを16進文字列に変換する機能を提供します。


メソッドの概要
static boolean compare(byte[] x, byte[] y)
          二つのバイト列を比較します。
static boolean compare(byte[] x, int xstart, byte[] y, int ystart, int length)
          二つのバイト配列の一部分を比較します。
static void dump(byte[] b)
          指定されたバイト列を System.out に 16 進ダンプします。
static void dump(byte[] b, int addr, int length)
          指定されたバイト配列の指定された領域を System.out に 16 進ダンプします。
static void dump(int[] b)
          指定された int 配列を System.out に 16 進ダンプします。
static void dump(int[] b, int addr, int length)
          指定された int 配列の指定された領域を System.out に 16 進ダンプします。
static String toHexString(byte b)
          指定されたバイトを表現する小文字の16進文字列を返します。
static String toHexString(int v)
          指定された int を表現する小文字の16進文字列を返します。
static String toHexString(long v)
          指定された long を表現する小文字の16進文字列を返します。
static String toHexStringUpper(byte b)
          指定されたバイトを表現する大文字の16進文字列を返します。
static String toHexStringUpper(int v)
          指定された int を表現する大文字の16進文字列を返します。
static String toHexStringUpper(long v)
          指定された long を表現する大文字の16進文字列を返します。
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

メソッドの詳細

compare

public static boolean compare(byte[] x,
                              byte[] y)
二つのバイト列を比較します。

パラメータ:
x - 比較するバイト列
y - 比較するバイト列
戻り値:
xy のバイト列の長さと各要素が一致する場合は true、そうでない場合は false

compare

public static boolean compare(byte[] x,
                              int xstart,
                              byte[] y,
                              int ystart,
                              int length)
二つのバイト配列の一部分を比較します。

パラメータ:
x - 比較するバイト列
xstart - 配列 x で比較を開始するインデックス
y - 比較するバイト列
ystart - 配列 y で比較を開始するインデックス
length - 比較するバイト数。 このパラメータに0を指定した場合、戻り値はtrueとなります。
戻り値:
xy のバイト配列の比較範囲での各要素が一致する場合は true、そうでない場合は false

dump

public static void dump(byte[] b)
指定されたバイト列を System.out に 16 進ダンプします。

パラメータ:
b - ダンプするバイト列

dump

public static void dump(byte[] b,
                        int addr,
                        int length)
指定されたバイト配列の指定された領域を System.out に 16 進ダンプします。

パラメータ:
b - バイト配列
addr - ダンプを開始するインデックス
length - ダンプするバイト数

dump

public static void dump(int[] b)
指定された int 配列を System.out に 16 進ダンプします。

パラメータ:
b - ダンプする int 配列

dump

public static void dump(int[] b,
                        int addr,
                        int length)
指定された int 配列の指定された領域を System.out に 16 進ダンプします。

パラメータ:
b - int 配列
addr - ダンプを開始するインデックス
length - ダンプする int の個数

toHexString

public static String toHexString(byte b)
指定されたバイトを表現する小文字の16進文字列を返します。

パラメータ:
b - バイト
戻り値:
b を16進で表現した小文字で2文字の文字列。

toHexStringUpper

public static String toHexStringUpper(byte b)
指定されたバイトを表現する大文字の16進文字列を返します。

パラメータ:
b - the byte.
戻り値:
b を16進で表現した大文字で2文字の文字列。

toHexString

public static String toHexString(int v)
指定された int を表現する小文字の16進文字列を返します。

パラメータ:
v - int
戻り値:
v を16進で表現した小文字で8文字の文字列。

toHexStringUpper

public static String toHexStringUpper(int v)
指定された int を表現する大文字の16進文字列を返します。

パラメータ:
v - int
戻り値:
v を16進で表現した大文字で8文字の文字列。

toHexString

public static String toHexString(long v)
指定された long を表現する小文字の16進文字列を返します。

パラメータ:
v - long
戻り値:
v を16進で表現した小文字で16文字の文字列。

toHexStringUpper

public static String toHexStringUpper(long v)
指定された long を表現する大文字の16進文字列を返します。

パラメータ:
v - long
戻り値:
v を16進で表現した大文字で16文字の文字列。

nanoJBlend

Copyright 2005-2013 Aplix and/or its affiliates. All rights reserved. Aplix Confidential and Restricted.
NTT DOCOMO and Hitachi Kokusai Electric Confidential