org.jruby.ext.ffi
Class MemoryUtil

java.lang.Object
  extended by org.jruby.ext.ffi.MemoryUtil

public final class MemoryUtil
extends java.lang.Object


Method Summary
static IRubyObject getArrayOfFloat32(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfFloat64(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfSigned16(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfSigned32(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfSigned64(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfSigned8(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfUnsigned16(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfUnsigned32(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfUnsigned64(Ruby runtime, MemoryIO io, long offset, int count)
           
static IRubyObject getArrayOfUnsigned8(Ruby runtime, MemoryIO io, long offset, int count)
           
static RubyString getTaintedByteString(Ruby runtime, MemoryIO io, long offset, int length)
          Reads a byte (binary) string from a memory object.
static IRubyObject getTaintedString(Ruby runtime, MemoryIO io, long offset)
          Gets a NUL terminated string from a memory object
static IRubyObject getTaintedString(Ruby runtime, MemoryIO io, long offset, int length)
          Reads a NUL terminated string from a memory object
static RubyString newTaintedString(Ruby runtime, byte[] bytes)
          Creates a ruby string from a byte array and sets the taint flag on it
static void putArrayOfFloat32(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfFloat64(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfSigned16(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfSigned32(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfSigned64(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfSigned8(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfUnsigned32(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
static void putArrayOfUnsigned8(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getArrayOfSigned8

public static final IRubyObject getArrayOfSigned8(Ruby runtime,
                                                  MemoryIO io,
                                                  long offset,
                                                  int count)

putArrayOfSigned8

public static final void putArrayOfSigned8(Ruby runtime,
                                           MemoryIO io,
                                           long offset,
                                           RubyArray ary)

getArrayOfUnsigned8

public static final IRubyObject getArrayOfUnsigned8(Ruby runtime,
                                                    MemoryIO io,
                                                    long offset,
                                                    int count)

putArrayOfUnsigned8

public static final void putArrayOfUnsigned8(Ruby runtime,
                                             MemoryIO io,
                                             long offset,
                                             RubyArray ary)

getArrayOfSigned16

public static final IRubyObject getArrayOfSigned16(Ruby runtime,
                                                   MemoryIO io,
                                                   long offset,
                                                   int count)

putArrayOfSigned16

public static final void putArrayOfSigned16(Ruby runtime,
                                            MemoryIO io,
                                            long offset,
                                            RubyArray ary)

getArrayOfUnsigned16

public static final IRubyObject getArrayOfUnsigned16(Ruby runtime,
                                                     MemoryIO io,
                                                     long offset,
                                                     int count)

getArrayOfSigned32

public static final IRubyObject getArrayOfSigned32(Ruby runtime,
                                                   MemoryIO io,
                                                   long offset,
                                                   int count)

putArrayOfSigned32

public static final void putArrayOfSigned32(Ruby runtime,
                                            MemoryIO io,
                                            long offset,
                                            RubyArray ary)

getArrayOfUnsigned32

public static final IRubyObject getArrayOfUnsigned32(Ruby runtime,
                                                     MemoryIO io,
                                                     long offset,
                                                     int count)

putArrayOfUnsigned32

public static final void putArrayOfUnsigned32(Ruby runtime,
                                              MemoryIO io,
                                              long offset,
                                              RubyArray ary)

getArrayOfSigned64

public static final IRubyObject getArrayOfSigned64(Ruby runtime,
                                                   MemoryIO io,
                                                   long offset,
                                                   int count)

putArrayOfSigned64

public static final void putArrayOfSigned64(Ruby runtime,
                                            MemoryIO io,
                                            long offset,
                                            RubyArray ary)

getArrayOfUnsigned64

public static final IRubyObject getArrayOfUnsigned64(Ruby runtime,
                                                     MemoryIO io,
                                                     long offset,
                                                     int count)

getArrayOfFloat32

public static final IRubyObject getArrayOfFloat32(Ruby runtime,
                                                  MemoryIO io,
                                                  long offset,
                                                  int count)

putArrayOfFloat32

public static final void putArrayOfFloat32(Ruby runtime,
                                           MemoryIO io,
                                           long offset,
                                           RubyArray ary)

getArrayOfFloat64

public static final IRubyObject getArrayOfFloat64(Ruby runtime,
                                                  MemoryIO io,
                                                  long offset,
                                                  int count)

putArrayOfFloat64

public static final void putArrayOfFloat64(Ruby runtime,
                                           MemoryIO io,
                                           long offset,
                                           RubyArray ary)

newTaintedString

public static final RubyString newTaintedString(Ruby runtime,
                                                byte[] bytes)
Creates a ruby string from a byte array and sets the taint flag on it

Parameters:
runtime - The ruby runtime
bytes - The array to make into a ruby string.
Returns:
A ruby string.

getTaintedByteString

public static final RubyString getTaintedByteString(Ruby runtime,
                                                    MemoryIO io,
                                                    long offset,
                                                    int length)
Reads a byte (binary) string from a memory object.

Parameters:
runtime - The ruby runtime
io - The memory object to read the string from
offset - The offset within the memory object to start reading
length - The number of bytes to read
Returns:
A ruby string

getTaintedString

public static final IRubyObject getTaintedString(Ruby runtime,
                                                 MemoryIO io,
                                                 long offset)
Gets a NUL terminated string from a memory object

Parameters:
runtime - The ruby runtime
io - The memory object to read the string from
offset - The offset within the memory object to start reading
Returns:
A ruby string

getTaintedString

public static final IRubyObject getTaintedString(Ruby runtime,
                                                 MemoryIO io,
                                                 long offset,
                                                 int length)
Reads a NUL terminated string from a memory object

Parameters:
runtime - The ruby runtime
io - The memory object to read the string from
offset - The offset within the memory object to start reading
maxlen - The maximum number of bytes to read
Returns:
A ruby string


Copyright © 2002-2007 JRuby Team. All Rights Reserved.