Class C4BlobStore

    • Method Detail

      • getSize

        public long getSize​(@NonNull
                            C4BlobKey blobKey)
        Gets the content size of a blob given its key. Returns -1 if it doesn't exist. WARNING: If the blob is encrypted, the return value is a conservative estimate that may be up to 16 bytes larger than the actual size.
      • getFilePath

        @Nullable
        public String getFilePath​(@NonNull
                                  C4BlobKey blobKey)
                           throws LiteCoreException
        Returns the path of the file that stores the blob, if possible. This call may fail with error kC4ErrorWrongFormat if the blob is encrypted (in which case the file would be unreadable by the caller) or with kC4ErrorUnsupported if for some implementation reason the blob isn't stored as a standalone file. Thus, the caller MUST use this function only as an optimization, and fall back to reading he contents via the API if it fails. Also, it goes without saying that the caller MUST not modify the file!
        Throws:
        LiteCoreException
      • openWriteStream

        @NonNull
        public C4BlobWriteStream openWriteStream()
                                          throws LiteCoreException
        Opens a write stream for creating a new blob. You should then call c4stream_write to write the data, ending with c4stream_install to compute the blob's key and add it to the store, and then c4stream_closeWriter.
        Throws:
        LiteCoreException
      • close

        public abstract void close()