Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-15 UTC."],[],[],null,["# Closeable\n=========\n\nArtifact: [androidx.datastore:datastore-core](/jetpack/androidx/releases/datastore) \n[View Source](https://cs.android.com/search?q=file:androidx/datastore/core/Closeable.kt+class:androidx.datastore.core.Closeable) \nAdded in [1.1.0](/jetpack/androidx/releases/datastore#1.1.0)\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/datastore/core/Closeable \"View this page in Java\")\nCommon/AllAndroid/JVMNative/C/iOS\n - Cmn \n\n ```\n interface Closeable\n``` \nKnown direct subclasses \n[ReadScope](/reference/kotlin/androidx/datastore/core/ReadScope), [StorageConnection](/reference/kotlin/androidx/datastore/core/StorageConnection) \n\n|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| [ReadScope](/reference/kotlin/androidx/datastore/core/ReadScope) | The scope used for a read transaction. |\n| [StorageConnection](/reference/kotlin/androidx/datastore/core/StorageConnection) | StorageConnection provides a way to read and write a particular type of data. |\n\nKnown indirect subclasses \n[WriteScope](/reference/kotlin/androidx/datastore/core/WriteScope) \n\n|--------------------------------------------------------------------|-----------------------------------------|\n| [WriteScope](/reference/kotlin/androidx/datastore/core/WriteScope) | The scope used for a write transaction. |\n\n*** ** * ** ***\n\nDatastore common version of java.io.Closeable\n\nSummary\n-------\n\n| ### Public functions |\n|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|-----|\n| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [close](/reference/kotlin/androidx/datastore/core/Closeable#close())`()` Closes the specified resource. | Cmn |\n\nPublic functions\n----------------\n\n### close\n\nCmn \nAdded in [1.1.0](/jetpack/androidx/releases/datastore#1.1.0) \n\n```\nfun close(): Unit\n```\n\nCloses the specified resource."]]