Package org.jruby.ext.ffi
Class MemoryUtil
java.lang.Object
org.jruby.ext.ffi.MemoryUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final IRubyObjectgetArrayOfFloat32(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfFloat64(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfSigned16(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfSigned32(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfSigned64(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfSigned8(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfUnsigned16(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfUnsigned32(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfUnsigned64(Ruby runtime, MemoryIO io, long offset, int count) static final IRubyObjectgetArrayOfUnsigned8(Ruby runtime, MemoryIO io, long offset, int count) static final RubyStringgetTaintedByteString(Ruby runtime, MemoryIO io, long offset, int length) Reads a byte (binary) string from a memory object.static final IRubyObjectgetTaintedString(Ruby runtime, MemoryIO io, long offset) Gets a NUL terminated string from a memory objectstatic final IRubyObjectgetTaintedString(Ruby runtime, MemoryIO io, long offset, int length) Reads a NUL terminated string from a memory objectstatic final RubyStringnewTaintedString(Ruby runtime, byte[] bytes) Creates a ruby string from a byte array and sets the taint flag on itstatic final voidputArrayOfFloat32(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfFloat64(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfSigned16(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfSigned32(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfSigned64(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfSigned8(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfUnsigned16(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfUnsigned32(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfUnsigned64(Ruby runtime, MemoryIO io, long offset, RubyArray ary) static final voidputArrayOfUnsigned8(Ruby runtime, MemoryIO io, long offset, RubyArray ary)
-
Constructor Details
-
MemoryUtil
private MemoryUtil()
-
-
Method Details
-
getArrayOfSigned8
public static final IRubyObject getArrayOfSigned8(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfSigned8
-
getArrayOfUnsigned8
public static final IRubyObject getArrayOfUnsigned8(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfUnsigned8
-
getArrayOfSigned16
public static final IRubyObject getArrayOfSigned16(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfSigned16
-
getArrayOfUnsigned16
public static final IRubyObject getArrayOfUnsigned16(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfUnsigned16
-
getArrayOfSigned32
public static final IRubyObject getArrayOfSigned32(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfSigned32
-
getArrayOfUnsigned32
public static final IRubyObject getArrayOfUnsigned32(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfUnsigned32
-
getArrayOfSigned64
public static final IRubyObject getArrayOfSigned64(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfSigned64
-
getArrayOfUnsigned64
public static final IRubyObject getArrayOfUnsigned64(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfUnsigned64
-
getArrayOfFloat32
public static final IRubyObject getArrayOfFloat32(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfFloat32
-
getArrayOfFloat64
public static final IRubyObject getArrayOfFloat64(Ruby runtime, MemoryIO io, long offset, int count) -
putArrayOfFloat64
-
newTaintedString
Creates a ruby string from a byte array and sets the taint flag on it- Parameters:
runtime- The ruby runtimebytes- 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 runtimeio- The memory object to read the string fromoffset- The offset within the memory object to start readinglength- The number of bytes to read- Returns:
- A ruby string
-
getTaintedString
Gets a NUL terminated string from a memory object- Parameters:
runtime- The ruby runtimeio- The memory object to read the string fromoffset- 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 runtimeio- The memory object to read the string fromoffset- The offset within the memory object to start readingmaxlen- The maximum number of bytes to read- Returns:
- A ruby string
-