public class ConvertUtils
extends java.lang.Object
| 构造器和说明 |
|---|
ConvertUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T[] |
toArray(java.util.List<T> list) |
static java.lang.String |
toBinaryString(byte... bytes)
To binary string string.
|
static java.lang.String |
toBinaryString(int num)
To binary string string.
|
static android.graphics.Bitmap |
toBitmap(byte[] bytes) |
static android.graphics.Bitmap |
toBitmap(byte[] bytes,
int width,
int height) |
static android.graphics.Bitmap |
toBitmap(android.graphics.drawable.Drawable drawable)
将Drawable转换为Bitmap
参考:http://kylines.iteye.com/blog/1660184
|
static android.graphics.Bitmap |
toBitmap(android.view.View view)
把view转化为bitmap(截图)
参见:http://www.cnblogs.com/lee0oo0/p/3355468.html
|
static byte[] |
toByteArray(android.graphics.Bitmap bitmap) |
static byte[] |
toByteArray(android.graphics.drawable.Drawable drawable) |
static byte[] |
toByteArray(java.io.InputStream is) |
static byte[] |
toByteArray(int i)
int占4字节
|
static byte[] |
toByteArray(java.lang.String hexData,
boolean isHex) |
static android.content.res.ColorStateList |
toColorStateList(int normalColor,
int pressedColor) |
static android.content.res.ColorStateList |
toColorStateList(int normalColor,
int pressedColor,
int focusedColor,
int unableColor)
对TextView、Button等设置不同状态时其文字颜色。
|
static java.lang.String |
toColorString(int color)
转换为6位十六进制颜色代码,不含“#”
|
static java.lang.String |
toColorString(int color,
boolean includeAlpha)
转换为6位十六进制颜色代码,不含“#”
|
static int |
toDarkenColor(int color) |
static int |
toDarkenColor(int color,
float value) |
static int |
toDp(android.content.Context context,
float pxValue)
px转换为dp
|
static android.graphics.drawable.Drawable |
toDrawable(android.graphics.Bitmap bitmap) |
static android.graphics.drawable.Drawable |
toDrawable(byte[] bytes) |
static java.lang.String |
toFileSizeString(long fileSize) |
static float |
toFloat(java.lang.Object obj) |
static java.lang.String |
toGbk(java.lang.String str) |
static java.lang.String |
toHexString(byte... bytes)
To hex string string.
|
static java.lang.String |
toHexString(int num)
To hex string string.
|
static java.lang.String |
toHexString(java.lang.String str) |
static int |
toInt(byte[] bytes) |
static int |
toInt(java.lang.Object obj) |
static <T> java.util.List<T> |
toList(T[] array) |
static long |
toLong(java.lang.Object obj) |
static java.lang.String |
toPath(android.content.Context context,
android.net.Uri uri)
从第三方文件选择器获取路径。
|
static int |
toPx(android.content.Context context,
float dpValue)
dp转换为px
|
static int |
toShort(byte first,
byte second) |
static java.lang.String |
toSlashString(java.lang.String str) |
static int |
toSp(android.content.Context context,
float pxValue)
px转换为sp
|
static java.lang.String |
toString(java.io.InputStream is) |
static java.lang.String |
toString(java.io.InputStream is,
java.lang.String charset) |
static java.lang.String |
toString(java.lang.Object[] objects) |
static java.lang.String |
toString(java.lang.Object[] objects,
java.lang.String tag) |
public static final long GB
public static final long MB
public static final long KB
public static int toInt(java.lang.Object obj)
public static int toInt(byte[] bytes)
public static int toShort(byte first,
byte second)
public static long toLong(java.lang.Object obj)
public static float toFloat(java.lang.Object obj)
public static byte[] toByteArray(int i)
i - thepublic static byte[] toByteArray(java.lang.String hexData,
boolean isHex)
public static java.lang.String toHexString(java.lang.String str)
public static java.lang.String toHexString(byte... bytes)
bytes - the bytespublic static java.lang.String toHexString(int num)
num - the numpublic static java.lang.String toBinaryString(byte... bytes)
bytes - the bytespublic static java.lang.String toBinaryString(int num)
num - the numpublic static java.lang.String toSlashString(java.lang.String str)
public static <T> T[] toArray(java.util.List<T> list)
public static <T> java.util.List<T> toList(T[] array)
public static java.lang.String toString(java.lang.Object[] objects)
public static java.lang.String toString(java.lang.Object[] objects,
java.lang.String tag)
public static byte[] toByteArray(java.io.InputStream is)
public static byte[] toByteArray(android.graphics.Bitmap bitmap)
public static android.graphics.Bitmap toBitmap(byte[] bytes,
int width,
int height)
public static android.graphics.Bitmap toBitmap(byte[] bytes)
public static android.graphics.Bitmap toBitmap(android.graphics.drawable.Drawable drawable)
public static java.lang.String toPath(android.content.Context context,
android.net.Uri uri)
public static android.graphics.Bitmap toBitmap(android.view.View view)
public static android.graphics.drawable.Drawable toDrawable(android.graphics.Bitmap bitmap)
public static byte[] toByteArray(android.graphics.drawable.Drawable drawable)
public static android.graphics.drawable.Drawable toDrawable(byte[] bytes)
public static int toPx(android.content.Context context,
float dpValue)
public static int toDp(android.content.Context context,
float pxValue)
public static int toSp(android.content.Context context,
float pxValue)
public static java.lang.String toGbk(java.lang.String str)
public static java.lang.String toFileSizeString(long fileSize)
public static java.lang.String toString(java.io.InputStream is,
java.lang.String charset)
public static java.lang.String toString(java.io.InputStream is)
public static int toDarkenColor(int color)
public static int toDarkenColor(int color,
float value)
public static java.lang.String toColorString(int color)
public static java.lang.String toColorString(int color,
boolean includeAlpha)
public static android.content.res.ColorStateList toColorStateList(int normalColor,
int pressedColor,
int focusedColor,
int unableColor)
public static android.content.res.ColorStateList toColorStateList(int normalColor,
int pressedColor)