Code example for ByteArrayInputStream

Methods: createFromStream

0
            return null;  
        }   
	} 
	 
	public static Drawable byteToDrawable(byte[] byteArray){
		ByteArrayInputStream ins = new ByteArrayInputStream(byteArray);
		return Drawable.createFromStream(ins, null);
	} 
	 
	public static byte[] Bitmap2Bytes(Bitmap bm){ 
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
		return baos.toByteArray();
	} 
	 
	public static Bitmap drawableToBitmap(Drawable drawable) {
 
		Bitmap bitmap = Bitmap
				.createBitmap(
						drawable.getIntrinsicWidth(),
Stop searching for code, let great code find you!  Add Codota to your java IDE