All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.mix.DFileInputStream Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
package com.jtransc.mix;

import com.jtransc.annotation.JTranscAddMembers;
import com.jtransc.annotation.JTranscMethodBody;

import java.io.IOException;
import java.io.InputStream;

@SuppressWarnings("unused")
@JTranscAddMembers(target = "d", value = {
	"public File file;",
	"public this(File file) { this.file = file; }",
})
class DFileInputStream extends InputStream {
	@Override
	@JTranscMethodBody(target = "d", value = {
		"if (this.file.eof) {",
		"	return -1;",
		"} else {",
		"	scope b = new byte[1];",
		"	scope o = this.file.rawRead(b);",
		"	return (o.length >= 1) ? b[0] : -1;",
		"}",
	})
	native public int read() throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy