code: @Override
    public byte[] transformIn(Blob blob) throws CpoException {
  
      byte[] buffBytes = new byte[1024];
      byte[] retBytes = null;
      int length;
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
  
      if (blob != null) {
        logger.debug("BLOB IS NOT NULL");
        try {
          InputStream is = blob.getBinaryStream();
  
          while ((length = is.read(buffBytes)) != -1) {
            bos.write(buffBytes, 0, length);
          }
          is.close();
          retBytes = bos.toByteArray();
          logger.debug("Got " + retBytes.length + " bytes");
        } catch (Exception e) {
          logger.debug("Error in transform blob", e);
          throw new CpoException(e);
        }
      }
      return retBytes;
    }
docs: Transforms the datasource object into an object required by the class
  
  @param cpoAdapter The CpoAdapter for the datasource where the attribute is being retrieved
  @param parentObject The object that contains the attribute being retrieved.
  @param The object that represents the datasource object being retrieved
  @return The object to be stored in the attribute
  @throws CpoException