New implementation for storage
This commit is contained in:
parent
89a0cf7b42
commit
91cd73a905
@ -1,5 +1,5 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = "1.2.40"
|
||||
ext.kotlin_version = "1.2.41"
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
|
@ -15,7 +15,7 @@ import java.util.*
|
||||
*/
|
||||
class NumassEnvelopeType : EnvelopeType {
|
||||
|
||||
override val code: Int = DefaultEnvelopeType.DEFAULT_ENVELOPE_TYPE
|
||||
override val code: Int = DefaultEnvelopeType.DEFAULT_ENVELOPE_CODE
|
||||
|
||||
override val name: String = "numass"
|
||||
|
||||
|
@ -54,7 +54,7 @@ val Envelope.dataStream: InputStream
|
||||
get() = if (this.meta.getString("compression", "none") == "zlib") {
|
||||
//TODO move to new type of data
|
||||
val inflatter = Inflater()
|
||||
inflatter.setInput(data.buffer.array())
|
||||
inflatter.setInput(data.read.array())
|
||||
val bos = ByteArrayOutputStream()
|
||||
val buffer = ByteArray(8192)
|
||||
while (!inflatter.finished()) {
|
||||
|
@ -72,7 +72,7 @@ interface NumassSet : Named, Metoid, Iterable<NumassPoint>, Provider {
|
||||
return optPoint(java.lang.Double.parseDouble(voltage))
|
||||
}
|
||||
|
||||
override fun defaultTarget(): String {
|
||||
override fun getDefaultTarget(): String {
|
||||
return NUMASS_POINT_PROVIDER_KEY
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class Main {
|
||||
throw new FileNotFoundException("Configuration file not found");
|
||||
}
|
||||
|
||||
Meta config = MetaFileReader.read(configFile);
|
||||
Meta config = MetaFileReader.Companion.read(configFile);
|
||||
|
||||
context.setValue(IOManager.ROOT_DIRECTORY_CONTEXT_KEY, configFile.getParent().toString());
|
||||
|
||||
|
@ -108,7 +108,7 @@ object NumassUtils {
|
||||
*/
|
||||
fun writeEnvelope(stream: OutputStream, meta: Meta, dataWriter: (OutputStream) -> Unit) {
|
||||
try {
|
||||
TaglessEnvelopeType.instance.writer.write(
|
||||
TaglessEnvelopeType.INSTANCE.writer.write(
|
||||
stream,
|
||||
EnvelopeBuilder()
|
||||
.setMeta(meta)
|
||||
|
@ -32,7 +32,7 @@ public class ServerRunner extends SimpleConfigurable implements AutoCloseable {
|
||||
Path configFile = context.getIo().getFile(SERVER_CONFIG_PATH).getPath();
|
||||
if (Files.exists(configFile)) {
|
||||
context.getLogger().info("Trying to read server configuration from {}", SERVER_CONFIG_PATH);
|
||||
configure(MetaFileReader.read(configFile));
|
||||
configure(MetaFileReader.Companion.read(configFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user