List of usage examples for java.io ByteArrayOutputStream toByteArray
public synchronized byte[] toByteArray()
From source file:Main.java
public static byte[] Bitmap2Bytes(Bitmap bm) { if (bm == null) return null; ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmapToBytes(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
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[] encodeToByteArray(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmap2Data(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] decodeByteFromBitmap(Bitmap bitmap) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 90, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] Bitmap2Bytes(Bitmap bm) { if (bm == null) { return null; }//from w w w . ja v a 2 s .c om ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmap2Bytes(Bitmap bm) { if (bm == null) { return null; }//from w w w . java2 s . com ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmap2Bytes(Bitmap bm, int quality) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, quality, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] getBytes(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 50, stream); return stream.toByteArray(); }