Bundle cc_bundle = null;   try { Bundle[] bundles = item.getBundles(CC_BUNDLE_NAME);  if ((bundles != null) && (bundles.length > 0)) { cc_bundle = bundles[0]; } else { return null; } } catch (Exception exc) {   return null; }  Bitstream bs = cc_bundle.getBitstreamByName(bitstream_name);
Bitstream bs = getBitstream(item, bitstream_name);
    private static byte[] getBytesFromBitstream(Item item, String bitstream_name)            throws SQLException, IOException, AuthorizeException    {        Bundle cc_bundle = null;        // look for the CC bundle        try        {            Bundle[] bundles = item.getBundles(CC_BUNDLE_NAME);            if ((bundles != null) && (bundles.length > 0))            {                cc_bundle = bundles[0];            }            else            {                return null;            }        }        catch (Exception exc)        {            // this exception catching is a bit generic,            // but basically it happens if there is no CC bundle            return null;        }        Bitstream bs = cc_bundle.getBitstreamByName(bitstream_name);        // no such bitstream        if (bs == null)        {            return null;        }        // create a ByteArrayOutputStream        ByteArrayOutputStream baos = new ByteArrayOutputStream();        Utils.copy(bs.retrieve(), baos);        return baos.toByteArray();    }