New implementation for storage

This commit is contained in:
Alexander Nozik 2018-05-03 22:46:27 +03:00
parent 89a0cf7b42
commit 91cd73a905
7 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = "1.2.40"
ext.kotlin_version = "1.2.41"
repositories {
jcenter()
maven {

View File

@ -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"

View File

@ -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()) {

View File

@ -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
}

View File

@ -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());

View File

@ -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)

View File

@ -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));
}
}