title: Trying to create a compressed bitmap in png format getting 2 errors
body: <p>I'm trying to create a bitmap that is compressed.</p>
  
  <p>I'm trying to use the bitmaps compress methed to save a compress bitmap in a Outputstream, then use decode stream to create a bitmap object from the Output stream.  </p>
  
  <p>My code has the following errors
  1. methed toByteArray is undefined for OutputStream
  2. Cannot initate the type outputstream.</p>
  
  <p>My code</p>
  
  <pre><code>inputStream=assetManager.open(sb.toString());  
  Bitmap b=BitmapFactory.decodeStream(inputStream);
  
  // this line produces a error saying cannot imitate OutputSream
  OutputStream out=new OutputStream();
  
  b.compress(Bitmap.CompressFormat.PNG, 100,out);
  
  // this ;ine has a error saying method does not exist
  Bitmap decoded = BitmapFactory.decodeStream( new ByteArrayInputStream(out.toByteArray()) );
  </code></pre>