public class FoxBaseConvertUtils
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
bitmap2Bytes(android.graphics.Bitmap bitmap,
android.graphics.Bitmap.CompressFormat format)
Bitmap to bytes.
|
static android.graphics.drawable.Drawable |
bitmap2Drawable(android.graphics.Bitmap bitmap)
Bitmap to drawable.
|
static byte[] |
bits2Bytes(java.lang.String bits)
Bits to bytes.
|
static android.graphics.Bitmap |
bytes2Bitmap(byte[] bytes)
Bytes to bitmap.
|
static java.lang.String |
bytes2Bits(byte[] bytes)
Bytes to bits.
|
static char[] |
bytes2Chars(byte[] bytes)
Bytes to chars.
|
static android.graphics.drawable.Drawable |
bytes2Drawable(byte[] bytes)
Bytes to drawable.
|
static java.lang.String |
bytes2HexString(byte[] bytes)
Bytes to hex string.
|
static java.io.InputStream |
bytes2InputStream(byte[] bytes)
Bytes to input stream.
|
static java.io.OutputStream |
bytes2OutputStream(byte[] bytes)
Bytes to output stream.
|
static byte[] |
chars2Bytes(char[] chars)
Chars to bytes.
|
static int |
dp2px(float dpValue)
Value of dp to value of px.
|
static android.graphics.Bitmap |
drawable2Bitmap(android.graphics.drawable.Drawable drawable)
Drawable to bitmap.
|
static byte[] |
drawable2Bytes(android.graphics.drawable.Drawable drawable,
android.graphics.Bitmap.CompressFormat format)
Drawable to bytes.
|
static byte[] |
hexString2Bytes(java.lang.String hexString)
Hex string to bytes.
|
java.io.ByteArrayInputStream |
output2InputStream(java.io.OutputStream out)
Output stream to input stream.
|
static byte[] |
outputStream2Bytes(java.io.OutputStream out)
Output stream to bytes.
|
static java.lang.String |
outputStream2String(java.io.OutputStream out,
java.lang.String charsetName)
Output stream to string.
|
static int |
px2dp(float pxValue)
Value of px to value of dp.
|
static int |
px2sp(float pxValue)
Value of px to value of sp.
|
static int |
sp2px(float spValue)
Value of sp to value of px.
|
static java.io.InputStream |
string2InputStream(java.lang.String string,
java.lang.String charsetName)
String to input stream.
|
static long |
String2Long(java.lang.String s) |
static java.io.OutputStream |
string2OutputStream(java.lang.String string,
java.lang.String charsetName)
String to output stream.
|
static android.graphics.Bitmap |
view2Bitmap(android.view.View view)
View to bitmap.
|
public static java.lang.String bytes2Bits(byte[] bytes)
bytes - The bytes.public static byte[] bits2Bytes(java.lang.String bits)
bits - The bits.public static char[] bytes2Chars(byte[] bytes)
bytes - The bytes.public static byte[] chars2Bytes(char[] chars)
chars - The chars.public static java.lang.String bytes2HexString(byte[] bytes)
e.g. bytes2HexString(new byte[] { 0, (byte) 0xa8 }) returns "00A8"
bytes - The bytes.public static byte[] hexString2Bytes(java.lang.String hexString)
e.g. hexString2Bytes("00A8") returns { 0, (byte) 0xA8 }
hexString - The hex string.public java.io.ByteArrayInputStream output2InputStream(java.io.OutputStream out)
out - The output stream.public static java.io.InputStream bytes2InputStream(byte[] bytes)
bytes - The bytes.public static byte[] outputStream2Bytes(java.io.OutputStream out)
out - The output stream.public static java.io.OutputStream bytes2OutputStream(byte[] bytes)
bytes - The bytes.public static java.io.InputStream string2InputStream(java.lang.String string,
java.lang.String charsetName)
string - The string.charsetName - The name of charset.public static java.lang.String outputStream2String(java.io.OutputStream out,
java.lang.String charsetName)
out - The output stream.charsetName - The name of charset.public static java.io.OutputStream string2OutputStream(java.lang.String string,
java.lang.String charsetName)
string - The string.charsetName - The name of charset.public static byte[] bitmap2Bytes(android.graphics.Bitmap bitmap,
android.graphics.Bitmap.CompressFormat format)
bitmap - The bitmap.format - The format of bitmap.public static android.graphics.Bitmap bytes2Bitmap(byte[] bytes)
bytes - The bytes.public static android.graphics.Bitmap drawable2Bitmap(android.graphics.drawable.Drawable drawable)
drawable - The drawable.public static android.graphics.drawable.Drawable bitmap2Drawable(android.graphics.Bitmap bitmap)
bitmap - The bitmap.public static byte[] drawable2Bytes(android.graphics.drawable.Drawable drawable,
android.graphics.Bitmap.CompressFormat format)
drawable - The drawable.format - The format of bitmap.public static android.graphics.drawable.Drawable bytes2Drawable(byte[] bytes)
bytes - The bytes.public static android.graphics.Bitmap view2Bitmap(android.view.View view)
view - The view.public static int dp2px(float dpValue)
dpValue - The value of dp.public static int px2dp(float pxValue)
pxValue - The value of px.public static int sp2px(float spValue)
spValue - The value of sp.public static int px2sp(float pxValue)
pxValue - The value of px.public static long String2Long(java.lang.String s)