Top Constructors Methods
org.jruby.ext.ffi

public final Class MemoryUtil

extends Object
Class Inheritance
Imports
org.jruby.Ruby, .RubyArray, .RubyBasicObject, .RubyFloat, .RubyString, org.jruby.api.Create, org.jruby.runtime.ThreadContext, org.jruby.runtime.builtin.IRubyObject

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static IRubyObject
getArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfSigned16(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfSigned32(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfSigned64(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfSigned8(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfUnsigned16(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfUnsigned32(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfUnsigned64(ThreadContext context, MemoryIO io, long offset, int count)

public static IRubyObject
getArrayOfUnsigned8(ThreadContext context, MemoryIO io, long offset, int count)

public static RubyString

Returns:

A ruby string
getTaintedByteString
(Ruby
The ruby runtime
runtime
,
MemoryIO
The memory object to read the string from
io
,
long
The offset within the memory object to start reading
offset
,
int
The number of bytes to read
length
)

Reads a byte (binary) string from a memory object.

public static IRubyObject

Returns:

A ruby string
getTaintedString
(Ruby
The ruby runtime
runtime
,
MemoryIO
The memory object to read the string from
io
,
long
The offset within the memory object to start reading
offset
)

Gets a NUL terminated string from a memory object

public static IRubyObject

Returns:

A ruby string
getTaintedString
(Ruby
The ruby runtime
runtime
,
MemoryIO
The memory object to read the string from
io
,
long
The offset within the memory object to start reading
offset
,
int
The maximum number of bytes to read
length
)

Reads a NUL terminated string from a memory object

public static RubyString

Returns:

A ruby string.
newTaintedString
(Ruby
The ruby runtime
runtime
,
byte[]
The array to make into a ruby string.
bytes
)

Creates a ruby string from a byte array

public static void
putArrayOfFloat32(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
Deprecated since 10.0.

public static void
putArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfFloat64(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
Deprecated since 10.0.

public static void
putArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfSigned16(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfSigned32(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfSigned64(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfSigned8(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfUnsigned16(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfUnsigned32(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfUnsigned64(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

public static void
putArrayOfUnsigned8(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MemoryUtilback to summary
private MemoryUtil()

Method Detail

getArrayOfFloat32back to summary
public static IRubyObject getArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfFloat64back to summary
public static IRubyObject getArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfSigned16back to summary
public static IRubyObject getArrayOfSigned16(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfSigned32back to summary
public static IRubyObject getArrayOfSigned32(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfSigned64back to summary
public static IRubyObject getArrayOfSigned64(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfSigned8back to summary
public static IRubyObject getArrayOfSigned8(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfUnsigned16back to summary
public static IRubyObject getArrayOfUnsigned16(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfUnsigned32back to summary
public static IRubyObject getArrayOfUnsigned32(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfUnsigned64back to summary
public static IRubyObject getArrayOfUnsigned64(ThreadContext context, MemoryIO io, long offset, int count)
getArrayOfUnsigned8back to summary
public static IRubyObject getArrayOfUnsigned8(ThreadContext context, MemoryIO io, long offset, int count)
getTaintedByteStringback to summary
public static RubyString getTaintedByteString(Ruby runtime, MemoryIO io, long offset, int length)

Reads a byte (binary) string from a memory object.

Parameters
runtime:Ruby

The ruby runtime

io:MemoryIO

The memory object to read the string from

offset:long

The offset within the memory object to start reading

length:int

The number of bytes to read

Returns:RubyString

A ruby string

getTaintedStringback to summary
public static IRubyObject getTaintedString(Ruby runtime, MemoryIO io, long offset)

Gets a NUL terminated string from a memory object

Parameters
runtime:Ruby

The ruby runtime

io:MemoryIO

The memory object to read the string from

offset:long

The offset within the memory object to start reading

Returns:IRubyObject

A ruby string

getTaintedStringback to summary
public static IRubyObject getTaintedString(Ruby runtime, MemoryIO io, long offset, int length)

Reads a NUL terminated string from a memory object

Parameters
runtime:Ruby

The ruby runtime

io:MemoryIO

The memory object to read the string from

offset:long

The offset within the memory object to start reading

length:int

The maximum number of bytes to read

Returns:IRubyObject

A ruby string

newTaintedStringback to summary
public static RubyString newTaintedString(Ruby runtime, byte[] bytes)

Creates a ruby string from a byte array

Parameters
runtime:Ruby

The ruby runtime

bytes:byte[]

The array to make into a ruby string.

Returns:RubyString

A ruby string.

putArrayOfFloat32back to summary
public static void putArrayOfFloat32(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
putArrayOfFloat32back to summary
public static void putArrayOfFloat32(ThreadContext context, MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfFloat64back to summary
public static void putArrayOfFloat64(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
putArrayOfFloat64back to summary
public static void putArrayOfFloat64(ThreadContext context, MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfSigned16back to summary
public static void putArrayOfSigned16(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfSigned32back to summary
public static void putArrayOfSigned32(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfSigned64back to summary
public static void putArrayOfSigned64(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfSigned8back to summary
public static void putArrayOfSigned8(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfUnsigned16back to summary
public static void putArrayOfUnsigned16(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfUnsigned32back to summary
public static void putArrayOfUnsigned32(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfUnsigned64back to summary
public static void putArrayOfUnsigned64(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)
putArrayOfUnsigned8back to summary
public static void putArrayOfUnsigned8(MemoryIO io, long offset, RubyArray<T extends IRubyObject> ary)