Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
BEGIN LICENSE BLOCK ***** Version: CPL 1.0/GPL 2.0/LGPL 2.1 The contents of this file are subject to the Common Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.eclipse.org/legal/cpl-v10.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyright (C) 2008 JRuby project Alternatively, the contents of this file may be used under the terms of either of the GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the CPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the CPL, the GPL or the LGPL. END LICENSE BLOCK ***
  
  
  package org.jruby.ext.ffi;
  
  import org.jruby.Ruby;
A abstract memory object that defines operations common to both pointers and memory buffers
  
  @JRubyClass(name="FFI::AbtractMemory" + ., parent="Object")
  abstract public class AbstractMemory extends RubyObject {
      public final static String ABSTRACT_MEMORY_RUBY_CLASS = "AbstractMemory";

    
The total size of the memory area
  
      protected long size;

    
The size of each element of this memory area - e.g. :char is 1, :int is 4
  
      protected int typeSize;

    
The Memory I/O object
  
      protected MemoryIO io;
      
      public static RubyClass createAbstractMemoryClass(Ruby runtimeRubyModule module) {
          RubyClass result = module.defineClassUnder(,
                  runtime.getObject(),
                  .);
          
          result.defineAnnotatedMethods(AbstractMemory.class);
          result.defineAnnotatedConstants(AbstractMemory.class);
  
          return result;
      }
      
      protected static final int calculateTypeSize(ThreadContext contextIRubyObject sizeArg) {
          if (sizeArg instanceof RubyFixnum) {
              return (int) ((RubyFixnumsizeArg).getLongValue();
  
          } else if (sizeArg instanceof RubySymbol) {
              return TypeSizeMapper.getTypeSize(context, (RubySymbolsizeArg);
  
          } else if (sizeArg instanceof Type) {
              return ((TypesizeArg).getNativeSize();
  
          } else {
              if (sizeArg instanceof RubyClass && Struct.isStruct(context.runtime, (RubyClasssizeArg)) {
                  return Struct.getStructSize(context.runtimesizeArg);
  
              } else if (sizeArg.respondsTo("size")) {
                  return (int) RubyFixnum.num2long(sizeArg.callMethod(context"size"));
  
              } else {
                  throw context.runtime.newArgumentError("Invalid size argument");
              }
          }
      }
  
     protected static final RubyArray checkArray(IRubyObject obj) {
         if (!(obj instanceof RubyArray)) {
             throw obj.getRuntime().newArgumentError("Array expected");
         }
         return (RubyArrayobj;
     }
 
     private static int checkArrayLength(IRubyObject val) {
         int i = RubyNumeric.num2int(val);
         if (i < 0) {
             throw val.getRuntime().newArgumentError("negative array length");
         }
 
         return i;
     }
 
     protected AbstractMemory(Ruby runtimeRubyClass klassMemoryIO iolong size) {
         this(runtimeklassiosize, 1);
     }
 
     protected AbstractMemory(Ruby runtimeRubyClass klassMemoryIO iolong sizeint typeSize) {
         super(runtimeklass);
         this. = io;
         this. = size;
         this. = typeSize;
     }

    
Gets the memory I/O accessor to read/write to the memory area.

Returns:
A memory accessor.
 
     public final MemoryIO getMemoryIO() {
         return ;
     }

    
Replaces the native memory object backing this ruby memory object

Parameters:
io The new memory I/O object
Returns:
The old memory I/O object
 
     protected final MemoryIO setMemoryIO(MemoryIO io) {
         MemoryIO old = this.;
         this. = io;
         return old;
     }

    
Calculates the absolute offset within the base memory pointer for a given offset.

Parameters:
offset The offset to add to the base offset.
Returns:
The total offset from the base memory pointer.
 
     protected final long getOffset(IRubyObject offset) {
         return Util.longValue(offset);
     }
    
    
Gets the size of the memory area.

Returns:
The size of the memory area.
 
     public final long getSize() {
         return this.;
     }

    
Calculates a hash code for the pointer.

Returns:
A RubyFixnum containing the hash code.
 
     @JRubyMethod(name = "hash")
     public RubyFixnum hash(ThreadContext context) {
         return context.runtime.newFixnum(hashCode());
     }
 
     @JRubyMethod(name = "to_s", optional = 1)
     public IRubyObject to_s(ThreadContext contextIRubyObject[] args) {
         return RubyString.newString(context.runtime + "[size=" +  + "]");
     }
 
     @JRubyMethod(name = "[]")
     public final IRubyObject aref(ThreadContext contextIRubyObject indexArg) {
         final int index = RubyNumeric.num2int(indexArg);
         final int offset = index * ;
         if (offset >= ) {
             throw context.runtime.newIndexError(String.format("Index %d out of range"index));
         }
         return slice(context.runtimeoffset);
     }

    
Compares this MemoryPointer to another MemoryPointer.

Parameters:
obj The other MemoryPointer to compare to.
Returns:
true if the memory address of obj is equal to the address of this MemoryPointer.
 
     @Override
     public boolean equals(Object obj) {
         if (!(obj instanceof AbstractMemory)) {
             return false;
         }
         final AbstractMemory other = (AbstractMemoryobj;
         return other.getMemoryIO().equals(getMemoryIO());
     }
     
     @JRubyMethod(name = "==", required = 1)
     @Override
     public IRubyObject op_equal(ThreadContext contextIRubyObject obj) {
         return context.runtime.newBoolean(this.equals(obj));
     }
     @Override
     public final boolean eql(IRubyObject other) {
         return this.equals(other);
     }
    
Calculates the hash code for this MemoryPointer

Returns:
The hashcode of the memory address.
 
     @Override
     public int hashCode() {
         return 67 * getMemoryIO().hashCode();
     }

    
Clears (zeros out) the memory contents.
 
     @JRubyMethod(name = "clear")
     public IRubyObject clear(ThreadContext context) {
         getMemoryIO().setMemory(0, , (byte) 0);
         return this;
     }

    
Gets the total size (in bytes) of the Memory.

Returns:
The total size in bytes.
 
     @JRubyMethod(name = { "total""size""length" })
     public IRubyObject total(ThreadContext context) {
         return RubyFixnum.newFixnum(context.runtime);
     }
    
    
Indicates how many bytes the intrinsic type of the memory uses.

Parameters:
context
Returns:
 
     @JRubyMethod(name = "type_size")
     public final IRubyObject type_size(ThreadContext context) {
         return context.runtime.newFixnum();
     }

    
Writes a 8 bit signed integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_char" } , required = 1)
     public IRubyObject write_char(ThreadContext contextIRubyObject value) {
         getMemoryIO().putByte(0, Util.int8Value(value));
 
         return this;
     }

    
Writes a 8 bit signed integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int8""put_char" } , required = 1)
     public IRubyObject put_int8(ThreadContext contextIRubyObject value) {
         getMemoryIO().putByte(0, Util.int8Value(value));
 
         return this;
     }

    
Writes a 8 bit signed integer value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int8""put_char" } , required = 2)
     public IRubyObject put_int8(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putByte(getOffset(offset), Util.int8Value(value));
 
         return this;
     }
    
    
Reads an 8 bit signed integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_char" })
     public IRubyObject read_char(ThreadContext context) {
         return Util.newSigned8(context.runtimegetMemoryIO().getByte(0));
     }

    
Reads an 8 bit signed integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int8""get_char" })
     public IRubyObject get_int8(ThreadContext context) {
         return Util.newSigned8(context.runtimegetMemoryIO().getByte(0));
     }

    
Reads an 8 bit signed integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int8""get_char" }, required = 1)
     public IRubyObject get_int8(ThreadContext contextIRubyObject offset) {
         return Util.newSigned8(context.runtimegetMemoryIO().getByte(getOffset(offset)));
     }

    
Writes a 8 bit unsigned integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_uchar" }, required = 1)
     public IRubyObject write_uchar(ThreadContext contextIRubyObject value) {
         getMemoryIO().putByte(0, (byte) Util.uint8Value(value));
         return this;
     }

    
Writes a 8 bit unsigned integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint8""put_uchar" }, required = 1)
     public IRubyObject put_uint8(ThreadContext contextIRubyObject value) {
         getMemoryIO().putByte(0, (byte) Util.uint8Value(value));
         return this;
     }

    
Writes a 8 bit unsigned integer value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint8""put_uchar" }, required = 2)
     public IRubyObject put_uint8(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putByte(getOffset(offset), (byte) Util.uint8Value(value));
         return this;
     }
    
    
Reads an 8 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_uchar" })
     public IRubyObject read_uchar(ThreadContext context) {
         return Util.newUnsigned8(context.runtimegetMemoryIO().getByte(0));
     }

    
Reads an 8 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint8""get_uchar" })
     public IRubyObject get_uint8(ThreadContext context) {
         return Util.newUnsigned8(context.runtimegetMemoryIO().getByte(0));
     }

    
Reads an 8 bit unsigned integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint8""get_uchar" }, required = 1)
     public IRubyObject get_uint8(ThreadContext contextIRubyObject offset) {
         return Util.newUnsigned8(context.runtimegetMemoryIO().getByte(getOffset(offset)));
     }

    
Writes a 16 bit signed integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_short" }, required = 1)
     public IRubyObject write_short(ThreadContext contextIRubyObject value) {
         getMemoryIO().putShort(0, Util.int16Value(value));
 
         return this;
     }

    
Writes a 16 bit signed integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int16""put_short" }, required = 1)
     public IRubyObject put_int16(ThreadContext contextIRubyObject value) {
         getMemoryIO().putShort(0, Util.int16Value(value));
 
         return this;
     }

    
Writes a 16 bit signed integer value to the memory address.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int16""put_short" }, required = 2)
     public IRubyObject put_int16(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putShort(getOffset(offset), Util.int16Value(value));
 
         return this;
     }

    
Reads a 16 bit signed integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_short" })
     public IRubyObject read_short(ThreadContext context) {
         return Util.newSigned16(context.runtimegetMemoryIO().getShort(0));
     }

    
Reads a 16 bit signed integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int16""get_short" })
     public IRubyObject get_int16(ThreadContext context) {
         return Util.newSigned16(context.runtimegetMemoryIO().getShort(0));
     }

    
Reads a 16 bit signed integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int16""get_short" }, required = 1)
     public IRubyObject get_int16(ThreadContext contextIRubyObject offset) {
         return Util.newSigned16(context.runtimegetMemoryIO().getShort(getOffset(offset)));
     }
    
    
Writes a 16 bit unsigned integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_ushort" }, required = 1)
     public IRubyObject write_ushort(ThreadContext contextIRubyObject value) {
         getMemoryIO().putShort(0, (short) Util.uint16Value(value));
 
         return this;
     }

    
Writes a 16 bit unsigned integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint16""put_ushort" }, required = 1)
     public IRubyObject put_uint16(ThreadContext contextIRubyObject value) {
         getMemoryIO().putShort(0, (short) Util.uint16Value(value));
 
         return this;
     }

    
Writes a 16 bit unsigned integer value to the memory address.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint16""put_ushort" }, required = 2)
     public IRubyObject put_uint16(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putShort(getOffset(offset), (short) Util.uint16Value(value));
 
         return this;
     }

    
Reads a 16 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_ushort" })
     public IRubyObject read_ushort(ThreadContext context) {
         return Util.newUnsigned16(context.runtimegetMemoryIO().getShort(0));
     }

    
Reads a 16 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint16""get_ushort" })
     public IRubyObject get_uint16(ThreadContext context) {
         return Util.newUnsigned16(context.runtimegetMemoryIO().getShort(0));
     }

    
Reads a 16 bit unsigned integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint16""get_ushort" }, required = 1)
     public IRubyObject get_uint16(ThreadContext contextIRubyObject offset) {
         return Util.newUnsigned16(context.runtimegetMemoryIO().getShort(getOffset(offset)));
     }

    
Writes a 32 bit signed integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_int" })
     public IRubyObject write_int(ThreadContext contextIRubyObject value) {
         getMemoryIO().putInt(0, Util.int32Value(value));
 
         return this;
     }

    
Writes a 32 bit signed integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int32""put_int" })
     public IRubyObject put_int32(ThreadContext contextIRubyObject value) {
         getMemoryIO().putInt(0, Util.int32Value(value));
 
         return this;
     }

    
Writes a 32 bit signed integer value to the memory address.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int32""put_int" }, required = 2)
     public IRubyObject put_int32(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putInt(getOffset(offset), Util.int32Value(value));
 
         return this;
     }

    
Reads a 32 bit signed integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_int" })
     public IRubyObject read_int(ThreadContext context) {
         return Util.newSigned32(context.runtimegetMemoryIO().getInt(0));
     }

    
Reads a 32 bit signed integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int32""get_int" })
     public IRubyObject get_int32(ThreadContext context) {
         return Util.newSigned32(context.runtimegetMemoryIO().getInt(0));
     }

    
Reads a 32 bit signed integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int32""get_int" }, required = 1)
     public IRubyObject get_int32(ThreadContext contextIRubyObject offset) {
         return Util.newSigned32(context.runtimegetMemoryIO().getInt(getOffset(offset)));
     }

    
Writes an 32 bit unsigned integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_uint" }, required = 1)
     public IRubyObject write_uint(ThreadContext contextIRubyObject value) {
         getMemoryIO().putInt(0, (int) Util.uint32Value(value));
 
         return this;
     }

    
Writes an 32 bit unsigned integer value to the memory address.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint32""put_uint" }, required = 1)
     public IRubyObject put_uint32(ThreadContext contextIRubyObject value) {
         getMemoryIO().putInt(0, (int) Util.uint32Value(value));
 
         return this;
     }

    
Writes an 32 bit unsigned integer value to the memory address.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint32""put_uint" }, required = 2)
     public IRubyObject put_uint32(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putInt(getOffset(offset), (int) Util.uint32Value(value));
 
         return this;
     }

    
Reads a 32 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_uint" })
     public IRubyObject read_uint(ThreadContext context) {
         return Util.newUnsigned32(context.runtimegetMemoryIO().getInt(0));
     }

    
Reads a 32 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint32""get_uint" })
     public IRubyObject get_uint32(ThreadContext context) {
         return Util.newUnsigned32(context.runtimegetMemoryIO().getInt(0));
     }

    
Reads a 32 bit unsigned integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint32""get_uint" }, required = 1)
     public IRubyObject get_uint32(ThreadContext contextIRubyObject offset) {
         return Util.newUnsigned32(context.runtimegetMemoryIO().getInt(getOffset(offset)));
     }
    
    
Writes a 64 bit integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_long_long" }, required = 1)
     public IRubyObject write_long_long(ThreadContext contextIRubyObject value) {
         getMemoryIO().putLong(0, Util.int64Value(value));
 
         return this;
     }

    
Writes a 64 bit integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int64""put_long_long" }, required = 1)
     public IRubyObject put_int64(ThreadContext contextIRubyObject value) {
         getMemoryIO().putLong(0, Util.int64Value(value));
 
         return this;
     }

    
Writes a 64 bit integer value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_int64""put_long_long" }, required = 2)
     public IRubyObject put_int64(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putLong(getOffset(offset), Util.int64Value(value));
 
         return this;
     }
    
    
Reads a 64 bit integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_long_long" })
     public IRubyObject read_long_long(ThreadContext context) {
         return Util.newSigned64(context.runtimegetMemoryIO().getLong(0));
     }

    
Reads a 64 bit integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int64""get_long_long" })
     public IRubyObject get_int64(ThreadContext context) {
         return Util.newSigned64(context.runtimegetMemoryIO().getLong(0));
     }

    
Reads a 64 bit integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_int64""get_long_long" }, required = 1)
     public IRubyObject get_int64(ThreadContext contextIRubyObject offset) {
         return Util.newSigned64(context.runtimegetMemoryIO().getLong(getOffset(offset)));
     }

    
Writes a 64 bit unsigned integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_ulong_long" }, required = 1)
     public IRubyObject write_ulong_long(ThreadContext contextIRubyObject value) {
         getMemoryIO().putLong(0, Util.uint64Value(value));
 
         return this;
     }

    
Writes a 64 bit unsigned integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint64""put_ulong_long" }, required = 1)
     public IRubyObject put_uint64(ThreadContext contextIRubyObject value) {
         getMemoryIO().putLong(0, Util.uint64Value(value));
 
         return this;
     }

    
Writes a 64 bit unsigned integer value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_uint64""put_ulong_long" }, required = 2)
     public IRubyObject put_uint64(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putLong(getOffset(offset), Util.uint64Value(value));
 
         return this;
     }

    
Reads a 64 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "read_ulong_long" })
     public IRubyObject read_ulong_long(ThreadContext context) {
         return Util.newUnsigned64(context.runtimegetMemoryIO().getLong(0));
     }

    
Reads a 64 bit unsigned integer value from the memory address.

Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint64""get_ulong_long" })
     public IRubyObject get_uint64(ThreadContext context) {
         return Util.newUnsigned64(context.runtimegetMemoryIO().getLong(0));
     }

    
Reads a 64 bit unsigned integer value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
 
     @JRubyMethod(name = { "get_uint64""get_ulong_long" }, required = 1)
     public IRubyObject get_uint64(ThreadContext contextIRubyObject offset) {
         return Util.newUnsigned64(context.runtimegetMemoryIO().getLong(getOffset(offset)));
     }

    
Writes a C long integer value to the memory area. This version is added to support the "write_long" alias for the single-arg "put_long".

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = "write_long", required = 1)
     public IRubyObject write_long(ThreadContext contextIRubyObject value) {
         return put_long(contextvalue);
     }

    
Writes a C long integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = "put_long", required = 1)
     public IRubyObject put_long(ThreadContext contextIRubyObject value) {
         return Platform.getPlatform().longSize() == 32
                 ? put_int32(contextvalue)
                 : put_int64(contextvalue);
     }

    
Writes a C long integer value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = "put_long", required = 2)
     public IRubyObject put_long(ThreadContext contextIRubyObject offsetIRubyObject value) {
         return Platform.getPlatform().longSize() == 32
                 ? put_int32(contextoffsetvalue)
                 : put_int64(contextoffsetvalue);
     }

    
Reads a C long integer value from the memory area.

Returns:
The value read.
 
     @JRubyMethod(name = { "read_long" })
     public IRubyObject read_long(ThreadContext context) {
         return get_long(context);
     }

    
Reads a C long integer value from the memory area.

Returns:
The value read.
 
     @JRubyMethod(name = { "get_long" })
     public IRubyObject get_long(ThreadContext context) {
         return Platform.getPlatform().longSize() == 32
                 ? get_int32(context) : get_int64(context);
     }

    
Reads a C long integer value from the memory area.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read.
 
     @JRubyMethod(name = "get_long", required = 1)
     public IRubyObject get_long(ThreadContext contextIRubyObject offset) {
         return Platform.getPlatform().longSize() == 32
                 ? get_int32(contextoffset)
                 : get_int64(contextoffset);
     }
    
    
Writes a C long integer value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_ulong""write_ulong" }, required = 1)
     public IRubyObject put_ulong(ThreadContext contextIRubyObject value) {
         return Platform.getPlatform().longSize() == 32
                 ? put_uint32(contextvalue)
                 : put_uint64(contextvalue);
     }

    
Writes a C long integer value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = "put_ulong", required = 2)
     public IRubyObject put_ulong(ThreadContext contextIRubyObject offsetIRubyObject value) {
         return Platform.getPlatform().longSize() == 32
                 ? put_uint32(contextoffsetvalue)
                 : put_uint64(contextoffsetvalue);
     }

    
    
Reads a C unsigned long integer value from the memory area.

Returns:
The value read.
 
     @JRubyMethod(name = { "read_ulong" })
     public IRubyObject read_ulong(ThreadContext context) {
         return get_ulong(context);
     }

    
Reads a C unsigned long integer value from the memory area.

Returns:
The value read.
 
     @JRubyMethod(name = { "get_ulong""read_ulong" })
     public IRubyObject get_ulong(ThreadContext context) {
         return Platform.getPlatform().longSize() == 32
                 ? get_uint32(context) : get_uint64(context);
     }

    
Reads a C unsigned long integer value from the memory area.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read.
 
     @JRubyMethod(name = "get_ulong", required = 1)
     public IRubyObject get_ulong(ThreadContext contextIRubyObject offset) {
         return Platform.getPlatform().longSize() == 32
                 ? get_uint32(contextoffset)
                 : get_uint64(contextoffset);
     }

    
Writes an 32 bit floating point value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "write_float" }, required = 1)
     public IRubyObject write_float(ThreadContext contextIRubyObject value) {
         getMemoryIO().putFloat(0, Util.floatValue(value));
 
         return this;
     }

    
Writes an 32 bit floating point value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_float32""put_float" }, required = 1)
     public IRubyObject put_float32(ThreadContext contextIRubyObject value) {
         getMemoryIO().putFloat(0, Util.floatValue(value));
 
         return this;
     }

    
Writes an 32 bit floating point value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
 
     @JRubyMethod(name = { "put_float32""put_float" }, required = 2)
     public IRubyObject put_float32(ThreadContext contextIRubyObject offsetIRubyObject value) {
         getMemoryIO().putFloat(getOffset(offset), Util.floatValue(value));
 
         return this;
     }

    
Reads a 32 bit floating point value from the memory address.

Returns:
The value read from the address.
    @JRubyMethod(name = { "read_float" })
    public IRubyObject read_float(ThreadContext context) {
        return RubyFloat.newFloat(context.runtimegetMemoryIO().getFloat(0));
    }

    
Reads a 32 bit floating point value from the memory address.

Returns:
The value read from the address.
    @JRubyMethod(name = { "get_float32""get_float" })
    public IRubyObject get_float32(ThreadContext context) {
        return RubyFloat.newFloat(context.runtimegetMemoryIO().getFloat(0));
    }

    
Reads a 32 bit floating point value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
    @JRubyMethod(name = { "get_float32""get_float" }, required = 1)
    public IRubyObject get_float32(ThreadContext contextIRubyObject offset) {
        return RubyFloat.newFloat(context.runtimegetMemoryIO().getFloat(getOffset(offset)));
    }
    
    
Writes an 64 bit floating point value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
    @JRubyMethod(name = { "write_double" }, required = 1)
    public IRubyObject write_double(ThreadContext contextIRubyObject value) {
        getMemoryIO().putDouble(0, Util.doubleValue(value));
        return this;
    }

    
Writes an 64 bit floating point value to the memory area.

Parameters:
value The value to write.
Returns:
The value written.
    @JRubyMethod(name = { "put_float64""put_double" }, required = 1)
    public IRubyObject put_float64(ThreadContext contextIRubyObject value) {
        getMemoryIO().putDouble(0, Util.doubleValue(value));
        return this;
    }

    
Writes an 64 bit floating point value to the memory area.

Parameters:
offset The offset from the base pointer address to write the value.
value The value to write.
Returns:
The value written.
    @JRubyMethod(name = { "put_float64""put_double" }, required = 2)
    public IRubyObject put_float64(ThreadContext contextIRubyObject offsetIRubyObject value) {
        getMemoryIO().putDouble(getOffset(offset), Util.doubleValue(value));
        return this;
    }

    
Reads a 64 bit floating point value from the memory address.

Returns:
The value read from the address.
    @JRubyMethod(name = { "read_double" })
    public IRubyObject read_double(ThreadContext context) {
        return RubyFloat.newFloat(context.runtimegetMemoryIO().getDouble(0));
    }

    
Reads a 64 bit floating point value from the memory address.

Returns:
The value read from the address.
    @JRubyMethod(name = { "get_float64""get_double" })
    public IRubyObject get_float64(ThreadContext context) {
        return RubyFloat.newFloat(context.runtimegetMemoryIO().getDouble(0));
    }

    
Reads a 64 bit floating point value from the memory address.

Parameters:
offset The offset from the base pointer address to read the value.
Returns:
The value read from the address.
    @JRubyMethod(name = { "get_float64""get_double" }, required = 1)
    public IRubyObject get_float64(ThreadContext contextIRubyObject offset) {
        return RubyFloat.newFloat(context.runtimegetMemoryIO().getDouble(getOffset(offset)));
    }

    
Reads an array of signed 8 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_int8""get_array_of_char" }, required = 2)
    public IRubyObject get_array_of_int8(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfSigned8(context.runtimegetOffset(offset), Util.int32Value(length));
    }

    
Writes an array of signed 8 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_int8""put_array_of_char" }, required = 2)
    public IRubyObject put_array_of_int8(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfSigned8(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of unsigned 8 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_uint8""get_array_of_uchar" }, required = 2)
    public IRubyObject get_array_of_uint8(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned8(context.runtimegetOffset(offset), Util.int32Value(length));
    }

    
Writes an array of unsigned 8 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_uint8""put_array_of_uchar" }, required = 2)
    public IRubyObject put_array_of_uint8(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfUnsigned8(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of signed 16 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_int16""get_array_of_short" }, required = 2)
    public IRubyObject get_array_of_int16(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfSigned16(context.runtimegetMemoryIO(), getOffset(offset), Util.int32Value(length));
    }

    
Writes an array of signed 16 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_int16""put_array_of_short" }, required = 2)
    public IRubyObject put_array_of_int16(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfSigned16(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        
        return this;
    }

    
Reads an array of unsigned 16 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_uint16""get_array_of_ushort" }, required = 2)
    public IRubyObject get_array_of_uint16(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned16(context.runtimegetMemoryIO(), getOffset(offset), Util.int32Value(length));
    }

    
Writes an array of unsigned 16 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_uint16""put_array_of_ushort" }, required = 2)
    public IRubyObject put_array_of_uint16(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfUnsigned16(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of signed 32 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_int32""get_array_of_int" }, required = 2)
    public IRubyObject get_array_of_int32(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfSigned32(context.runtimegetMemoryIO(), getOffset(offset), Util.int32Value(length));
    }

    
Writes an array of signed 32 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_int32""put_array_of_int" }, required = 2)
    public IRubyObject put_array_of_int32(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfSigned32(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of unsigned 32 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_uint32""get_array_of_uint" }, required = 2)
    public IRubyObject get_array_of_uint32(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned32(context.runtimegetMemoryIO(), getOffset(offset), Util.int32Value(length));
    }

    
Writes an array of unsigned 32 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_uint32""put_array_of_uint" }, required = 2)
    public IRubyObject put_array_of_uint32(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfUnsigned32(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of signed long integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = "get_array_of_long", required = 2)
    public IRubyObject get_array_of_long(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return Platform.getPlatform().longSize() == 32
                ? get_array_of_int32(contextoffsetlength)
                : get_array_of_int64(contextoffsetlength);
    }

    
Writes an array of signed long integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = "put_array_of_long", required = 2)
    public IRubyObject put_array_of_long(ThreadContext contextIRubyObject offsetIRubyObject arr) {
        return Platform.getPlatform().longSize() == 32
                ? put_array_of_int32(contextoffsetarr)
                : put_array_of_int64(contextoffsetarr);
    }

    
Reads an array of unsigned long integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = "get_array_of_ulong", required = 2)
    public IRubyObject get_array_of_ulong(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return Platform.getPlatform().longSize() == 32
                ? get_array_of_uint32(contextoffsetlength)
                : get_array_of_uint64(contextoffsetlength);
    }

    
Writes an array of unsigned long integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = "put_array_of_ulong", required = 2)
    public IRubyObject put_array_of_ulong(ThreadContext contextIRubyObject offsetIRubyObject arr) {
        return Platform.getPlatform().longSize() == 32
                ? put_array_of_uint32(contextoffsetarr)
                : put_array_of_uint64(contextoffsetarr);
    }

    
Reads an array of signed 64 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
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 contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfSigned64(context.runtimegetOffset(offset), Util.int32Value(length));
    }

    
Writes an array of signed 64 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_int64""put_array_of_long_long" }, required = 2)
    public IRubyObject put_array_of_int64(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfSigned64(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of unsigned 64 bit integer values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_uint64""get_array_of_ulong_long" }, required = 2)
    public IRubyObject get_array_of_uint64(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned64(context.runtimegetOffset(offset), Util.int32Value(length));
    }

    
Writes an array of unsigned 64 bit integer values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_uint64""put_array_of_ulong_long" }, required = 2)
    public IRubyObject put_array_of_uint64(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfUnsigned64(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of signed 32 bit floating point values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_float32""get_array_of_float" }, required = 2)
    public IRubyObject get_array_of_float(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfFloat32(context.runtimegetOffset(offset), Util.int32Value(length));
    }

    
Writes an array of 32 bit floating point values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
length The number of values to be written to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_float32""put_array_of_float" }, required = 2)
    public IRubyObject put_array_of_float(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfFloat32(context.runtimegetOffset(offset), checkArray(arrParam));
        return this;
    }

    
Reads an array of signed 64 bit floating point values from the memory address.

Parameters:
offset The offset from the start of the memory area to read the values.
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "get_array_of_float64""get_array_of_double" }, required = 2)
    public IRubyObject get_array_of_float64(ThreadContext contextIRubyObject offsetIRubyObject length) {
        return MemoryUtil.getArrayOfFloat64(context.runtimegetOffset(offset), Util.int32Value(length));
    }

    
Writes an array of 64 bit floating point values to the memory area.

Parameters:
offset The offset from the start of the memory area to write the values.
arrParam Array of values to write to memory.
Returns:
this object.
    @JRubyMethod(name = { "put_array_of_float64""put_array_of_double" }, required = 2)
    public IRubyObject put_array_of_float64(ThreadContext contextIRubyObject offsetIRubyObject arrParam) {
        MemoryUtil.putArrayOfFloat64(context.runtimegetMemoryIO(), getOffset(offset), checkArray(arrParam));
        return this;
    }
    
    
Reads an array of signed 8 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_int8""read_array_of_char" }, required = 1)
    public IRubyObject read_array_of_int8(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfSigned8(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of signed 8 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_int8""write_array_of_char" }, required = 1)
    public IRubyObject write_array_of_int8(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfSigned8(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }
    
    
Reads an array of unsigned 8 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_uint8""read_array_of_uchar" }, required = 1)
    public IRubyObject read_array_of_uint8(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned8(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of unsigned 8 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
ary Array of values to write to memory.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_uint8""write_array_of_uchar" }, required = 1)
    public IRubyObject write_array_of_uint8(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfUnsigned8(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }
    
    
Reads an array of signed 16 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_int16""read_array_of_short" }, required = 1)
    public IRubyObject read_array_of_int16(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfSigned16(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of signed 16 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_int16""write_array_of_short" }, required = 1)
    public IRubyObject write_array_of_int16(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfSigned16(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }
    
    
Reads an array of unsigned 16 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_uint16""read_array_of_ushort" }, required = 1)
    public IRubyObject read_array_of_uint16(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned16(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of unsigned 16 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_uint16""write_array_of_ushort" }, required = 1)
    public IRubyObject write_array_of_uint16(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfUnsigned16(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }
    
    
    
Reads an array of signed 32 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_int32""read_array_of_int" }, required = 1)
    public IRubyObject read_array_of_int32(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfSigned32(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of signed 32 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_int32""write_array_of_int" }, required = 1)
    public IRubyObject write_array_of_int32(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfSigned32(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }
    
    
Reads an array of unsigned 32 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_uint32""read_array_of_uint" }, required = 1)
    public IRubyObject read_array_of_uint32(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned32(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of unsigned 32 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_uint32""write_array_of_uint" }, required = 1)
    public IRubyObject write_array_of_uint32(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfUnsigned32(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }

    
Reads an array of signed 64 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_int64""read_array_of_long_long" }, required = 1)
    public IRubyObject read_array_of_int64(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfSigned64(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of signed 64 bit integer values to the memory area.

Parameters:
ary The array of values to write to the memory area.
Returns:
this object.
    @JRubyMethod(name = { "write_array_of_int64""write_array_of_long_long" }, required = 1)
    public IRubyObject write_array_of_int64(ThreadContext contextIRubyObject ary) {
        MemoryUtil.putArrayOfSigned64(context.runtimegetMemoryIO(), 0, checkArray(ary));
        return this;
    }
    
    
Reads an array of unsigned 64 bit integer values from the memory address.

Parameters:
length The number of values to be read from memory.
Returns:
An array containing the values.
    @JRubyMethod(name = { "read_array_of_uint64""read_array_of_ulong_long" }, required = 1)
    public IRubyObject read_array_of_uint64(ThreadContext contextIRubyObject length) {
        return MemoryUtil.getArrayOfUnsigned64(context.runtime, 0, Util.int32Value(length));
    }

    
Writes an array of unsigned 64 bit integer values to the memory area.

Parameters:
ary Th