Skip to content

Commit abb6473

Browse files
JAVA-37490 Kotlin - Cleanup un-committed or un-ignored artifacts
2 parents c7b9d87 + a9eb987 commit abb6473

File tree

1 file changed

+3
-1
lines changed
  • core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/deleteFileContent

1 file changed

+3
-1
lines changed

core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/deleteFileContent/DeleteFileContent.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class DeleteFileContent {
2828
}
2929

3030
fun withRandomAccessFile(file: File) {
31-
RandomAccessFile(file, "rw").setLength(0)
31+
val randomAccessFile = RandomAccessFile(file, "rw")
32+
randomAccessFile.setLength(0)
33+
randomAccessFile.close()
3234
}
3335

3436
fun withFileChannel(file: File) {

0 commit comments

Comments
 (0)