private Resource packIcon(int dpi,Bitmap icon){
  Resource res=new Resource();
  res.dpi=dpi;
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  if (icon.compress(IMAGE_FORMAT,IMAGE_COMPRESSION_QUALITY,os)) {
    res.data=os.toByteArray();
  }
  return res;
}

private Resource packIcon ( int dpi , Bitmap icon ) { Resource res = new Resource ( ) ; res . dpi = dpi ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; if ( icon . compress ( IMAGE_FORMAT , IMAGE_COMPRESSION_QUALITY , os ) ) { res . data = os . toByteArray ( ) ; } return res ; }
serialize an icon resource for persistence , including a checksum wrapper .
