List of usage examples for java.io ByteArrayOutputStream toByteArray
public synchronized byte[] toByteArray()
From source file:Main.java
public static byte[] bitmapToByte(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmapToBytes(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmapToByte(Bitmap bitmap) { ByteArrayOutputStream out = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); return out.toByteArray(); }
From source file:Main.java
public static byte[] bitmap2Bytes(Bitmap bm, Bitmap.CompressFormat format, int quality) { try {/*from www. j a v a2 s . co m*/ ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(format, quality, baos); return baos.toByteArray(); } finally { bm.recycle(); } }
From source file:Main.java
public static byte[] Bitmap2Bytes(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] getBitmapByte(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] getBitmapInBytes(Bitmap b) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); b.compress(Bitmap.CompressFormat.JPEG, 50, stream); return stream.toByteArray(); }
From source file:Main.java
public static final byte[] toByte(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 0, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] getByteArrayFromBitmap(Bitmap map) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); map.compress(Bitmap.CompressFormat.JPEG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] getBitmapData(Bitmap photo) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); photo.compress(Bitmap.CompressFormat.JPEG, 70, baos); return baos.toByteArray(); }