org.jclarion.clarion.memory.CMem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clarion-runtime Show documentation
Show all versions of clarion-runtime Show documentation
JClarion runtime environment
package org.jclarion.clarion.memory;
import org.jclarion.clarion.runtime.CMemory;
public abstract class CMem implements Cloneable
{
public abstract CMem clone();
public static CMem create()
{
return new CharBufferCMem();
}
public static CMem create(int size)
{
return new CharBufferCMem(size);
}
public static byte[] toByteArray(CMem in)
{
byte[] result = new byte[in.remaining()];
for (int scan=0;scan=remain;
}
public void writeInt(int aInt)
{
writeByte(aInt);
writeByte(aInt>>8);
writeByte(aInt>>16);
writeByte(aInt>>24);
}
public void writeString(CharSequence seq)
{
for (int scan=0;scan0 ) {
a.append(readChar());
maxLength--;
}
}
public Object readObject()
{
return CMemory.resolveAddress(readInt());
}
public final void reset()
{
resetRead();
resetWrite();
}
public static void fromByteArray(CMem sos, byte[] sA) {
for (byte b : sA) {
sos.writeByte(b);
}
}
public void writeBytes(byte[] buffer, int ofs, int len)
{
len=len+ofs;
while (ofs
© 2015 - 2025 Weber Informatics LLC | Privacy Policy