dev.monosoul.jooq.util.ConfigurationCopy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jooq-gradle-plugin Show documentation
Show all versions of jooq-gradle-plugin Show documentation
Generates jOOQ classes using dockerized database
package dev.monosoul.jooq.util
import org.jooq.meta.jaxb.Configuration
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
internal fun Configuration.copy(): Configuration {
val serialized =
ByteArrayOutputStream().apply {
ObjectOutputStream(this).use { oos ->
oos.writeObject(this@copy)
}
}.toByteArray()
return ObjectInputStream(ByteArrayInputStream(serialized)).use { ois ->
ois.readObject() as Configuration
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy