public class Bytes extends Object
限定符和类型 | 方法和说明 |
---|---|
static byte[] |
base642bytes(String str)
from base64 string.
|
static byte[] |
base642bytes(String str,
char[] code)
from base64 string.
|
static byte[] |
base642bytes(String str,
int offset,
int length)
from base64 string.
|
static byte[] |
base642bytes(String str,
int off,
int len,
char[] code)
from base64 string.
|
static byte[] |
base642bytes(String str,
int off,
int len,
String code)
from base64 string.
|
static byte[] |
base642bytes(String str,
String code)
from base64 string.
|
static String |
bytes2base64(byte[] b)
to base64 string.
|
static String |
bytes2base64(byte[] b,
char[] code)
to base64 string.
|
static String |
bytes2base64(byte[] b,
int offset,
int length)
to base64 string.
|
static String |
bytes2base64(byte[] bs,
int off,
int len,
char[] code)
to base64 string.
|
static String |
bytes2base64(byte[] b,
int offset,
int length,
String code)
to base64 string.
|
static String |
bytes2base64(byte[] b,
String code)
to base64 string.
|
static double |
bytes2double(byte[] b)
to long.
|
static double |
bytes2double(byte[] b,
int off)
to long.
|
static float |
bytes2float(byte[] b)
to int.
|
static float |
bytes2float(byte[] b,
int off)
to int.
|
static String |
bytes2hex(byte[] bs)
to hex string.
|
static String |
bytes2hex(byte[] bs,
int off,
int len)
to hex string.
|
static int |
bytes2int(byte[] b)
to int.
|
static int |
bytes2int(byte[] b,
int off)
to int.
|
static long |
bytes2long(byte[] b)
to long.
|
static long |
bytes2long(byte[] b,
int off)
to long.
|
static short |
bytes2short(byte[] b)
to short.
|
static short |
bytes2short(byte[] b,
int off)
to short.
|
static byte[] |
copyOf(byte[] src,
int length)
byte array copy.
|
static byte[] |
double2bytes(double v)
to byte array.
|
static void |
double2bytes(double v,
byte[] b)
to byte array.
|
static void |
double2bytes(double v,
byte[] b,
int off)
to byte array.
|
static byte[] |
float2bytes(float v)
to byte array.
|
static void |
float2bytes(float v,
byte[] b)
to byte array.
|
static void |
float2bytes(float v,
byte[] b,
int off)
to byte array.
|
static byte[] |
getMD5(byte[] source)
get md5.
|
static byte[] |
getMD5(File file)
get md5.
|
static byte[] |
getMD5(InputStream is)
get md5.
|
static byte[] |
getMD5(String str)
get md5.
|
static byte[] |
hex2bytes(String str)
from hex string.
|
static byte[] |
hex2bytes(String str,
int off,
int len)
from hex string.
|
static byte[] |
int2bytes(int v)
to byte array.
|
static void |
int2bytes(int v,
byte[] b)
to byte array.
|
static void |
int2bytes(int v,
byte[] b,
int off)
to byte array.
|
static byte[] |
long2bytes(long v)
to byte array.
|
static void |
long2bytes(long v,
byte[] b)
to byte array.
|
static void |
long2bytes(long v,
byte[] b,
int off)
to byte array.
|
static byte[] |
short2bytes(short v)
to byte array.
|
static void |
short2bytes(short v,
byte[] b)
to byte array.
|
static void |
short2bytes(short v,
byte[] b,
int off)
to byte array.
|
static byte[] |
unzip(byte[] bytes)
unzip.
|
static byte[] |
zip(byte[] bytes)
zip.
|
public static byte[] copyOf(byte[] src, int length)
src
- src.length
- new length.public static byte[] short2bytes(short v)
v
- value.public static void short2bytes(short v, byte[] b)
v
- value.b
- byte array.public static void short2bytes(short v, byte[] b, int off)
v
- value.b
- byte array.public static byte[] int2bytes(int v)
v
- value.public static void int2bytes(int v, byte[] b)
v
- value.b
- byte array.public static void int2bytes(int v, byte[] b, int off)
v
- value.b
- byte array.off
- array offset.public static byte[] float2bytes(float v)
v
- value.public static void float2bytes(float v, byte[] b)
v
- value.b
- byte array.public static void float2bytes(float v, byte[] b, int off)
v
- value.b
- byte array.off
- array offset.public static byte[] long2bytes(long v)
v
- value.public static void long2bytes(long v, byte[] b)
v
- value.b
- byte array.public static void long2bytes(long v, byte[] b, int off)
v
- value.b
- byte array.off
- array offset.public static byte[] double2bytes(double v)
v
- value.public static void double2bytes(double v, byte[] b)
v
- value.b
- byte array.public static void double2bytes(double v, byte[] b, int off)
v
- value.b
- byte array.off
- array offset.public static short bytes2short(byte[] b)
b
- byte array.public static short bytes2short(byte[] b, int off)
b
- byte array.off
- offset.public static int bytes2int(byte[] b)
b
- byte array.public static int bytes2int(byte[] b, int off)
b
- byte array.off
- offset.public static float bytes2float(byte[] b)
b
- byte array.public static float bytes2float(byte[] b, int off)
b
- byte array.off
- offset.public static long bytes2long(byte[] b)
b
- byte array.public static long bytes2long(byte[] b, int off)
b
- byte array.off
- offset.public static double bytes2double(byte[] b)
b
- byte array.public static double bytes2double(byte[] b, int off)
b
- byte array.off
- offset.public static String bytes2hex(byte[] bs)
bs
- byte array.public static String bytes2hex(byte[] bs, int off, int len)
bs
- byte array.off
- offset.len
- length.public static byte[] hex2bytes(String str)
str
- hex string.public static byte[] hex2bytes(String str, int off, int len)
str
- hex string.off
- offset.len
- length.public static String bytes2base64(byte[] b)
b
- byte array.public static String bytes2base64(byte[] b, int offset, int length)
b
- byte array.public static String bytes2base64(byte[] b, String code)
b
- byte array.code
- base64 code string(0-63 is base64 char,64 is pad char).public static String bytes2base64(byte[] b, int offset, int length, String code)
b
- byte array.code
- base64 code string(0-63 is base64 char,64 is pad char).public static String bytes2base64(byte[] b, char[] code)
b
- byte array.code
- base64 code(0-63 is base64 char,64 is pad char).public static String bytes2base64(byte[] bs, int off, int len, char[] code)
bs
- byte array.off
- offset.len
- length.code
- base64 code(0-63 is base64 char,64 is pad char).public static byte[] base642bytes(String str)
str
- base64 string.public static byte[] base642bytes(String str, int offset, int length)
str
- base64 string.offset
- offset.length
- length.public static byte[] base642bytes(String str, String code)
str
- base64 string.code
- base64 code(0-63 is base64 char,64 is pad char).public static byte[] base642bytes(String str, int off, int len, String code)
str
- base64 string.off
- offset.len
- length.code
- base64 code(0-63 is base64 char,64 is pad char).public static byte[] base642bytes(String str, char[] code)
str
- base64 string.code
- base64 code(0-63 is base64 char,64 is pad char).public static byte[] base642bytes(String str, int off, int len, char[] code)
str
- base64 string.off
- offset.len
- length.code
- base64 code(0-63 is base64 char,64 is pad char).public static byte[] zip(byte[] bytes) throws IOException
bytes
- source.IOException
public static byte[] unzip(byte[] bytes) throws IOException
bytes
- compressed byte array.IOException
public static byte[] getMD5(String str)
str
- input string.public static byte[] getMD5(byte[] source)
source
- byte array source.public static byte[] getMD5(File file) throws IOException
file
- file source.IOException
public static byte[] getMD5(InputStream is) throws IOException
is
- input stream.IOException
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.