1
0
mirror of https://github.com/quinton-ashley/java2js synced 2024-12-29 10:11:54 +01:00
java2js/jre/java/io/InputStream.js
Quinton Ashley e9c4dd302e 1.0.2
2021-09-23 19:56:21 -05:00

22 lines
376 B
JavaScript
Executable File

jre.imports['java.io.InputStream'].load = () => {
class InputStream {
constructor() {
this.reset();
let _this = this;
if (window?.ide) {
ide.log.onkeyup = () => {
_this.stream = ide.log.value;
};
}
}
reset() {
this.stream = '';
this.mark = 0;
}
read(length) {
this.mark += length;
}
}
jre.java.io.InputStream = InputStream;
};