One thing to note, if you are using AEM as Cloud service
com.day.cq.dam.api.AssetManager.createAsset(String, InputStream, String, boolean)
In AEM as a Cloud Service, assets should instead take advantage of direct binary access. A discussion of this change as well as an SDK to ease implementation ...