couchbase/couchbase-lite-android#66

Fixes couchbase/couchbase-lite-android#66 by porting code from iOS