Verified Commit de020554 authored by AtjonTV's avatar AtjonTV

Extensions: Add objectInputStream and objectOutputStream extensions to File

parent 80c7e4aa
......@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- JsonKraken 2.0 dependency
- `objectOutputStream` extension for File
- `objectInputStream` extension for File
### Changed
- Upgraded Kotlin from 1.3.61 to 1.3.70
### Deprecated
......
......@@ -2,6 +2,8 @@ package klib.extensions
import java.io.File
import java.io.FileNotFoundException
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import java.net.URL
import klib.hash.HashResult
import klib.hash.Sha1
......@@ -121,3 +123,19 @@ fun File.reset() {
fun File.fromUrl(url: URL) {
url.toFile(this)
}
/**
* Open a Object Output Stream on a File
*
* @since 5.0.0
* @author Thomas Obernosterer
*/
fun File.objectOutputStream() = ObjectOutputStream(this.outputStream())
/**
* Open a Object Input Stream on a File
*
* @since 5.0.0
* @author Thomas Obernosterer
*/
fun File.objectInputStream() = ObjectInputStream(this.inputStream())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment