Package org.jruby.ext.ffi
Class MemoryUtil
java.lang.Object
org.jruby.ext.ffi.MemoryUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObject
getArrayOfFloat32
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfFloat64
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfSigned16
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfSigned32
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfSigned64
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfSigned8
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfUnsigned16
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfUnsigned32
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfUnsigned64
(ThreadContext context, MemoryIO io, long offset, int count) static IRubyObject
getArrayOfUnsigned8
(ThreadContext context, 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 objectstatic IRubyObject
getTaintedString
(Ruby runtime, MemoryIO io, long offset, int length) Reads a NUL terminated string from a memory objectstatic RubyString
newTaintedString
(Ruby runtime, byte[] bytes) Creates a ruby string from a byte arraystatic void
putArrayOfFloat32
(MemoryIO io, long offset, RubyArray ary) Deprecated.static void
putArrayOfFloat32
(ThreadContext context, MemoryIO io, long offset, RubyArray ary) static void
putArrayOfFloat64
(MemoryIO io, long offset, RubyArray ary) Deprecated.static void
putArrayOfFloat64
(ThreadContext context, MemoryIO io, long offset, RubyArray ary) static void
putArrayOfSigned16
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfSigned32
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfSigned64
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfSigned8
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfUnsigned16
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfUnsigned32
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfUnsigned64
(MemoryIO io, long offset, RubyArray ary) static void
putArrayOfUnsigned8
(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
-