Refine search
/** * Reads an 8 bit unsigned integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_uint8", "get_uchar" }, required = 1) public IRubyObject get_uint8(ThreadContext context, IRubyObject offset) { return Util.newUnsigned8(context.runtime, getMemoryIO().getByte(getOffset(offset))); }
/** * Writes a 32 bit signed integer value to the memory address. * * @param offset The offset from the base pointer address to write the value. * @param value The value to write. * @return The value written. */ @JRubyMethod(name = { "put_int32", "put_int" }, required = 2) public IRubyObject put_int32(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putInt(getOffset(offset), Util.int32Value(value)); return this; }
/** * Reads a 32 bit signed integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_int32", "get_int" }, required = 1) public IRubyObject get_int32(ThreadContext context, IRubyObject offset) { return Util.newSigned32(context.runtime, getMemoryIO().getInt(getOffset(offset))); }
/** * Writes an 32 bit unsigned integer value to the memory address. * * @param offset The offset from the base pointer address to write the value. * @param value The value to write. * @return The value written. */ @JRubyMethod(name = { "put_uint32", "put_uint" }, required = 2) public IRubyObject put_uint32(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putInt(getOffset(offset), (int) Util.uint32Value(value)); return this; }
/** * Reads a 64 bit integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_int64", "get_long_long" }, required = 1) public IRubyObject get_int64(ThreadContext context, IRubyObject offset) { return Util.newSigned64(context.runtime, getMemoryIO().getLong(getOffset(offset))); }
/** * Reads a 64 bit unsigned integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_uint64", "get_ulong_long" }, required = 1) public IRubyObject get_uint64(ThreadContext context, IRubyObject offset) { return Util.newUnsigned64(context.runtime, getMemoryIO().getLong(getOffset(offset))); }
/** * Reads an array of signed 8 bit integer values from the memory address. * * @param offset The offset from the start of the memory area to read the values. * @param length The number of values to be read from memory. * @return An array containing the values. */ @JRubyMethod(name = { "get_array_of_int8", "get_array_of_char" }, required = 2) public IRubyObject get_array_of_int8(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned8(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); }
/** * Writes an array of signed 8 bit integer values to the memory area. * * @param offset The offset from the start of the memory area to write the values. * @param length The number of values to be written to memory. * @return <tt>this</tt> object. */ @JRubyMethod(name = { "put_array_of_int8", "put_array_of_char" }, required = 2) public IRubyObject put_array_of_int8(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned8(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); return this; }
/** * Reads an array of signed 64 bit integer values from the memory address. * * @param offset The offset from the start of the memory area to read the values. * @param length The number of values to be read from memory. * @return An array containing the values. */ @JRubyMethod(name = { "get_array_of_int64", "get_array_of_long_long" }, required = 2) public IRubyObject get_array_of_int64(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned64(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); }
/** * Writes an array of signed 64 bit integer values to the memory area. * * @param offset The offset from the start of the memory area to write the values. * @param length The number of values to be written to memory. * @return <tt>this</tt> object. */ @JRubyMethod(name = { "put_array_of_int64", "put_array_of_long_long" }, required = 2) public IRubyObject put_array_of_int64(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned64(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); return this; }
/** * Writes a 16 bit signed integer value to the memory address. * * @param offset The offset from the base pointer address to write the value. * @param value The value to write. * @return The value written. */ @JRubyMethod(name = { "put_int16", "put_short" }, required = 2) public IRubyObject put_int16(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putShort(getOffset(offset), Util.int16Value(value)); return this; }
/** * Writes an 32 bit floating point value to the memory area. * * @param offset The offset from the base pointer address to write the value. * @param value The value to write. * @return The value written. */ @JRubyMethod(name = { "put_float32", "put_float" }, required = 2) public IRubyObject put_float32(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putFloat(getOffset(offset), Util.floatValue(value)); return this; }
/** * Reads an array of signed 16 bit integer values from the memory address. * * @param offset The offset from the start of the memory area to read the values. * @param length The number of values to be read from memory. * @return An array containing the values. */ @JRubyMethod(name = { "get_array_of_int16", "get_array_of_short" }, required = 2) public IRubyObject get_array_of_int16(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned16(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); }
/** * Reads an array of unsigned 16 bit integer values from the memory address. * * @param offset The offset from the start of the memory area to read the values. * @param length The number of values to be read from memory. * @return An array containing the values. */ @JRubyMethod(name = { "get_array_of_uint16", "get_array_of_ushort" }, required = 2) public IRubyObject get_array_of_uint16(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned16(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); }
/** * Writes an array of signed 32 bit integer values to the memory area. * * @param offset The offset from the start of the memory area to write the values. * @param length The number of values to be written to memory. * @return <tt>this</tt> object. */ @JRubyMethod(name = { "put_array_of_int32", "put_array_of_int" }, required = 2) public IRubyObject put_array_of_int32(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned32(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); return this; }
/** * Reads an 8 bit signed integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_int8", "get_char" }, required = 1) public IRubyObject get_int8(ThreadContext context, IRubyObject offset) { return Util.newSigned8(context.runtime, getMemoryIO().getByte(getOffset(offset))); }
/** * Writes a 16 bit unsigned integer value to the memory address. * * @param offset The offset from the base pointer address to write the value. * @param value The value to write. * @return The value written. */ @JRubyMethod(name = { "put_uint16", "put_ushort" }, required = 2) public IRubyObject put_uint16(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putShort(getOffset(offset), (short) Util.uint16Value(value)); return this; }
/** * Reads a 16 bit unsigned integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_uint16", "get_ushort" }, required = 1) public IRubyObject get_uint16(ThreadContext context, IRubyObject offset) { return Util.newUnsigned16(context.runtime, getMemoryIO().getShort(getOffset(offset))); }
/** * Reads a 32 bit unsigned integer value from the memory address. * * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ @JRubyMethod(name = { "get_uint32", "get_uint" }, required = 1) public IRubyObject get_uint32(ThreadContext context, IRubyObject offset) { return Util.newUnsigned32(context.runtime, getMemoryIO().getInt(getOffset(offset))); }
/** * Writes a 64 bit unsigned integer value to the memory area. * * @param offset The offset from the base pointer address to write the value. * @param value The value to write. * @return The value written. */ @JRubyMethod(name = { "put_uint64", "put_ulong_long" }, required = 2) public IRubyObject put_uint64(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putLong(getOffset(offset), Util.uint64Value(value)); return this; }