Package org.jruby.ext.ffi
Class MemoryUtil
java.lang.Object
org.jruby.ext.ffi.MemoryUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObjectgetArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfSigned16(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfSigned32(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfSigned64(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfSigned8(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfUnsigned16(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfUnsigned32(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfUnsigned64(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObjectgetArrayOfUnsigned8(ThreadContext context, MemoryIO io, long offset, int count) static RubyStringgetTaintedByteString(Ruby runtime, MemoryIO io, long offset, int length) Reads a byte (binary) string from a memory object.static IRubyObjectgetTaintedString(Ruby runtime, MemoryIO io, long offset) Gets a NUL terminated string from a memory objectstatic IRubyObjectgetTaintedString(Ruby runtime, MemoryIO io, long offset, int length) Reads a NUL terminated string from a memory objectstatic RubyStringnewTaintedString(Ruby runtime, byte[] bytes) Creates a ruby string from a byte arraystatic voidputArrayOfFloat32(MemoryIO io, long offset, RubyArray ary) Deprecated.static voidputArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, RubyArray ary) static voidputArrayOfFloat64(MemoryIO io, long offset, RubyArray ary) Deprecated.static voidputArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, RubyArray ary) static voidputArrayOfSigned16(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfSigned32(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfSigned64(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfSigned8(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfUnsigned16(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfUnsigned32(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfUnsigned64(MemoryIO io, long offset, RubyArray ary) static voidputArrayOfUnsigned8(MemoryIO io, long offset, RubyArray ary)
-
Method Details
-
getArrayOfSigned8
public static IRubyObject getArrayOfSigned8(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfSigned8
-
getArrayOfUnsigned8
public static IRubyObject getArrayOfUnsigned8(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfUnsigned8
-
getArrayOfSigned16
public static IRubyObject getArrayOfSigned16(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfSigned16
-
getArrayOfUnsigned16
public static IRubyObject getArrayOfUnsigned16(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfUnsigned16
-
getArrayOfSigned32
public static IRubyObject getArrayOfSigned32(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfSigned32
-
getArrayOfUnsigned32
public static IRubyObject getArrayOfUnsigned32(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfUnsigned32
-
getArrayOfSigned64
public static IRubyObject getArrayOfSigned64(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfSigned64
-
getArrayOfUnsigned64
public static IRubyObject getArrayOfUnsigned64(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfUnsigned64
-
getArrayOfFloat32
public static IRubyObject getArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfFloat32
@Deprecated(since="10.0") public static void putArrayOfFloat32(MemoryIO io, long offset, RubyArray ary) Deprecated. -
putArrayOfFloat32
public static void putArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, RubyArray ary) -
getArrayOfFloat64
public static IRubyObject getArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, int count) -
putArrayOfFloat64
@Deprecated(since="10.0") public static void putArrayOfFloat64(MemoryIO io, long offset, RubyArray ary) Deprecated. -
putArrayOfFloat64
public static void putArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, RubyArray ary) -
newTaintedString
Creates a ruby string from a byte array- Parameters:
runtime- The ruby runtimebytes- The array to make into a ruby string.- Returns:
- A ruby string.
-
getTaintedByteString
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
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 readinglength- The maximum number of bytes to read- Returns:
- A ruby string
-