com.jtransc.io.ra.RAByteArray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-rt-core Show documentation
Show all versions of jtransc-rt-core Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
package com.jtransc.io.ra;
public class RAByteArray extends RAStream {
byte[] data;
public RAByteArray(byte[] data) {
this.data = data;
}
@Override
public void setLength(long length) {
throw new UnsupportedOperationException();
}
@Override
public long getLength() {
return data.length;
}
@Override
protected int read(long position, byte[] ref, int pos, int len) {
long epos = Math.min(data.length, position + len);
int finalLen = (int)(epos - position);
System.arraycopy(data, (int) position, ref, pos, finalLen);
return finalLen;
}
@Override
protected void write(long position, byte[] ref, int pos, int len) {
throw new UnsupportedOperationException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy