code: public static Map marshalMap(List<Class<?>> mapGenericClasses, Class keyClass, Class valueClass, Map rawMap)
      {
          Map dataCollection = new HashMap();
  
          if (keyClass.isAssignableFrom(BytesType.class) || valueClass.isAssignableFrom(BytesType.class))
          {
              Iterator iter = rawMap.keySet().iterator();
  
              while (iter.hasNext())
              {
  
                  Object key = iter.next();
                  Object value = rawMap.get(key);
  
                  if (keyClass.isAssignableFrom(BytesType.class))
                  {
                      byte[] keyAsBytes = new byte[((ByteBuffer) value).remaining()];
                      ((ByteBuffer) key).get(keyAsBytes);
                      key = PropertyAccessorHelper.getObject(mapGenericClasses.get(0), keyAsBytes);
                  }
  
                  if (valueClass.isAssignableFrom(BytesType.class))
                  {
                      byte[] valueAsBytes = new byte[((ByteBuffer) value).remaining()];
                      ((ByteBuffer) value).get(valueAsBytes);
                      value = PropertyAccessorHelper.getObject(mapGenericClasses.get(1), valueAsBytes);
                  }
  
                  dataCollection.put(key, value);
              }
          }
          return dataCollection;
      }
docs: In case, key or value class is of type blob. Iterate and populate
  corresponding byte[]
  
  @param mapGenericClasses
  the map generic classes
  @param keyClass
  the key class
  @param valueClass
  the value class
  @param rawMap
  the raw map
  @return the map