Bug: Saving a blob with InputStream

Platform: Android
CBL: 2.6 CE

Saving a blob with ByteArrayInputStream which extends from InputStream

new Blob("image/jpeg", getPicture(bitmap)
// ...
public static ByteArrayInputStream getPicture(Bitmap bitmap) {
ByteArrayInputStream myByteArrayInputStream = new ByteArrayInputStream(// ...);
// ...
return myByteArrayInputStream;
}

an error is thrown at SG:
[INF] SyncMsg: c:[5b1db747] #39: Type:rev --> 400 Incorrect data sent for attachment with digest: sha1-lcJZ/lBqNbS23v0aIzI+LmSxwxA= Time:66.291689ms

and in Android Studio it’s logged as:
E/CouchbaseLite/REPLICATOR: {N8litecore4repl6PusherE#1} Got error response to rev '7JFlD2OEV7U2ZBYiBXCC20aEaIL2::khj8xbs2yw3n::item::b55bea1b804a' #4-23fae3d30ea8398c9750e39637d52618ac7a3068 (seq #545): HTTP 400 'Incorrect data sent for attachment with digest: sha1-lcJZ/lBqNbS23v0aIzI+LmSxwxA='

If I wrap the ByteArrayInputStream with org.apache.commons.io.IOUtils.toByteArray there is no error and the blob is pushed up.

new Blob("image/jpeg", IOUtils.toByteArray(getPicture(bitmap))

Posted here as the issues tab was removed on Github.

There are instructions about how to file issues in the repo. TL;DR couchbase-lite-android contains only common code now and couchbase-lite-android proper was split into two repos: couchbase-lite-android-ce (public) and couchbase-lite-android-ee (private).

Created issue on Github: https://github.com/couchbase/couchbase-lite-android-ce/issues/23