Top Inners Constructors Methods
org.jruby.ext.ffi.jffi

pack-priv final Class NilPointerParameterStrategy

extends PointerParameterStrategy
Class Inheritance
Imports
org.jruby.ext.ffi.MemoryIO, java.nio.ByteBuffer, .ByteOrder

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final MemoryIO
Inherited from org.jruby.ext.ffi.jffi.PointerParameterStrategy:
addressisReferenceRequiredlengthobjectoffset

Constructor Detail

NilPointerParameterStrategyback to summary
pack-priv NilPointerParameterStrategy()

Method Detail

getMemoryIOback to summary
public final MemoryIO getMemoryIO(Object parameter)

Implements abstract org.jruby.ext.ffi.jffi.PointerParameterStrategy.getMemoryIO.

org.jruby.ext.ffi.jffi back to summary

pack-priv final Class NilPointerParameterStrategy.NullMemoryIO

extends MemoryIO
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final MemoryIO
Inherited from org.jruby.ext.ffi.MemoryIO:
addressisDirect

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
public int
public int
public ByteBuffer
asByteBuffer()

Implements abstract org.jruby.ext.ffi.MemoryIO.asByteBuffer.

Creates a view of this memory object as a java NIO byte buffer.

public MemoryIO
dup()

Implements abstract org.jruby.ext.ffi.MemoryIO.dup.

Duplicates this MemoryIO, including its contents.

private static final RuntimeException
ex()

public void
get(long
The offset within the memory area to read the bytes.
offset
,
byte[]
The output byte array to place the data.
dst
,
int
The offset within the byte array to start copying.
off
,
int
The length of data to read.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Reads an array of bytes from the memory area at the specified offset.

public void
get(long
The offset within the memory area to read the shorts.
offset
,
short[]
The output array to place the data in.
dst
,
int
The offset within the array to start copying.
off
,
int
The number of shorts to read.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Reads an array of shorts from the memory area at the specified offset.

public void
get(long
The offset within the memory area to read the ints.
offset
,
int[]
The output array to place the data in.
dst
,
int
The offset within the array to start copying.
off
,
int
The number of ints to read.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Reads an array of ints from the memory area at the specified offset.

public void
get(long
The offset within the memory area to read the longs.
offset
,
long[]
The output array to place the data in.
dst
,
int
The offset within the array to start copying.
off
,
int
The number of longs to read.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Reads an array of longs from the memory area at the specified offset.

public void
get(long
The offset within the memory area to read the floats.
offset
,
float[]
The output array to place the data in.
dst
,
int
The offset within the array to start copying.
off
,
int
The number of floats to read.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Reads an array of floats from the memory area at the specified offset.

public void
get(long
The offset within the memory area to read the doubles.
offset
,
double[]
The output array to place the data in.
dst
,
int
The offset within the array to start copying.
off
,
int
The number of doubles to read.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Reads an array of doubles from the memory area at the specified offset.

public long
getAddress(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getAddress.

Reads a pointer value at the specified offset within the memory area.

public byte
getByte(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getByte.

Reads an 8 bit integer value from the memory area.

public double
getDouble(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getDouble.

Reads a double value from the memory area.

public float
getFloat(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getFloat.

Reads a float value from the memory area.

public int
getInt(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getInt.

Reads a 32 bit integer value from the memory area.

public long
getLong(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getLong.

Reads a 64 bit integer value from the memory area.

public MemoryIO
getMemoryIO(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getMemoryIO.

Reads a pointer value at the specified offset within the memory area, and wraps it in an abstract memory accessor.

public long
getNativeLong(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getNativeLong.

Reads a native long integer value from the memory area.

public short
getShort(long
The offset within the memory area to read the value.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getShort.

Reads a 16 bit integer value from the memory area.

public byte[]
getZeroTerminatedByteArray(long
The offset within the memory area of the start of the string.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getZeroTerminatedByteArray.

Reads a zero terminated byte array (e.g. an ascii or utf-8 string)

public byte[]
getZeroTerminatedByteArray(long
The offset within the memory area of the start of the string.
offset
,
int
The maximum length to search for the zero byte terminator.
maxlen
)

Implements abstract org.jruby.ext.ffi.MemoryIO.getZeroTerminatedByteArray.

Reads a zero terminated byte array (e.g. an ascii or utf-8 string)

public int
indexOf(long
The offset within the memory area to start searching.
offset
,
byte
The value to search for.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.indexOf.

Gets the first index within the memory area of a particular 8 bit value.

public int
indexOf(long
The offset within the memory area to start searching.
offset
,
byte
The value to search for.
value
,
int maxlen)

Implements abstract org.jruby.ext.ffi.MemoryIO.indexOf.

Gets the first index within the memory area of a particular 8 bit value.

public ByteOrder
order()

Implements abstract org.jruby.ext.ffi.MemoryIO.order.

Gets the ByteOrder this MemoryIO instance will read/write values to memory in.

public void
put(long
The offset within the memory area to start writing the bytes.
offset
,
byte[]
The byte array to write to the memory area.
src
,
int
The offset within the byte array to start copying.
off
,
int
The length of data to write.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Writes an array of bytes to the memory area at the specified offset.

public void
put(long
The offset within the memory area to start writing the shorts.
offset
,
short[]
The array to write to the memory area.
src
,
int
The offset within the array to start copying.
off
,
int
The number of shorts to write.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Writes an array of shorts to the memory area at the specified offset.

public void
put(long
The offset within the memory area to start writing the ints.
offset
,
int[]
The array to write to the memory area.
src
,
int
The offset within the array to start copying.
off
,
int
The number of ints to write.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Writes an array of ints to the memory area at the specified offset.

public void
put(long
The offset within the memory area to start writing the longs.
offset
,
long[]
The array to write to the memory area.
src
,
int
The offset within the array to start copying.
off
,
int
The number of longs to write.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Writes an array of longs to the memory area at the specified offset.

public void
put(long
The offset within the memory area to start writing the floats.
offset
,
float[]
The array to write to the memory area.
src
,
int
The offset within the array to start copying.
off
,
int
The number of floats to write.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Writes an array of floats to the memory area at the specified offset.

public void
put(long
The offset within the memory area to start writing the doubles.
offset
,
double[]
The array to write to the memory area.
src
,
int
The offset within the array to start copying.
off
,
int
The number of doubles to write.
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Writes an array of doubles to the memory area at the specified offset.

public void
putAddress(long
The offset within the memory area to write the value.
offset
,
long
The pointer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putAddress.

Writes a pointer value to the memory area at the specified offset.

public void
putByte(long
The offset within the memory area to write the value.
offset
,
byte
The 8 bit integer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putByte.

Writes an 8 bit integer value to the memory area at the specified offset.

public void
putDouble(long
The offset within the memory area to write the value.
offset
,
double
The 64 bit float value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putDouble.

Writes a 64 bit float value to the memory area at the specified offset.

public void
putFloat(long
The offset within the memory area to write the value.
offset
,
float
The 32 bit float value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putFloat.

Writes a 32 bit float value to the memory area at the specified offset.

public void
putInt(long
The offset within the memory area to write the value.
offset
,
int
The 32 bit integer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putInt.

Writes a 32 bit integer value to the memory area at the specified offset.

public void
putLong(long
The offset within the memory area to write the value.
offset
,
long
The 64 bit integer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putLong.

Writes a 64 bit integer value to the memory area at the specified offset.

public void
putMemoryIO(long
The offset within the memory area to write the value.
offset
,
MemoryIO
The pointer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putMemoryIO.

Writes a pointer value to the memory area at the specified offset.

public void
putNativeLong(long
The offset within the memory area to write the value.
offset
,
long
The native long integer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putNativeLong.

Writes a native long integer value to the memory area at the specified offset.

public void
putShort(long
The offset within the memory area to write the value.
offset
,
short
The 16 bit integer value to write to the memory location.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putShort.

Writes a 16 bit integer value to the memory area at the specified offset.

public void
putZeroTerminatedByteArray(long
The offset within the memory area of the start of the string.
offset
,
byte[]
The byte array to write to the memory.
bytes
,
int
The offset with the byte array to start copying.
off
,
int
The number of bytes of the byte array to write to the memory area. (not including zero byte)
len
)

Implements abstract org.jruby.ext.ffi.MemoryIO.putZeroTerminatedByteArray.

Writes a byte array to memory, and appends a zero terminator

public void
setMemory(long
The offset within the memory area to start writing.
offset
,
long
The number of bytes to set to the value.
size
,
byte
The value to set each byte to.
value
)

Implements abstract org.jruby.ext.ffi.MemoryIO.setMemory.

Sets the contents of the memory area to the value.

public MemoryIO
slice(long
The offset within the existing memory area to start the new MemoryIO at.
offset
)

Implements abstract org.jruby.ext.ffi.MemoryIO.slice.

Creates a new MemoryIO pointing to a subset of the memory area of this MemoryIO.

public MemoryIO
slice(long
The offset within the existing memory area to start the new MemoryIO at.
offset
,
long
The size of the new slice.
size
)

Implements abstract org.jruby.ext.ffi.MemoryIO.slice.

Creates a new MemoryIO pointing to a subset of the memory area of this MemoryIO.

Inherited from org.jruby.ext.ffi.MemoryIO:
addressisDirectisNull

Field Detail

INSTANCEback to summary
pack-priv static final MemoryIO INSTANCE

Constructor Detail

NullMemoryIOback to summary
private NullMemoryIO()

Method Detail

arrayback to summary
public Object array()

Implements abstract org.jruby.ext.ffi.MemoryIO.array.

arrayLengthback to summary
public int arrayLength()

Implements abstract org.jruby.ext.ffi.MemoryIO.arrayLength.

arrayOffsetback to summary
public int arrayOffset()

Implements abstract org.jruby.ext.ffi.MemoryIO.arrayOffset.

asByteBufferback to summary
public ByteBuffer asByteBuffer()

Implements abstract org.jruby.ext.ffi.MemoryIO.asByteBuffer.

Doc from org.jruby.ext.ffi.MemoryIO.asByteBuffer.

Creates a view of this memory object as a java NIO byte buffer.

Returns:ByteBuffer

A ByteBuffer instance

dupback to summary
public MemoryIO dup()

Implements abstract org.jruby.ext.ffi.MemoryIO.dup.

Doc from org.jruby.ext.ffi.MemoryIO.dup.

Duplicates this MemoryIO, including its contents.

Returns:MemoryIO

A MemoryIO instance.

exback to summary
private static final RuntimeException ex()
getback to summary
public void get(long offset, byte[] dst, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Doc from org.jruby.ext.ffi.MemoryIO.get.

Reads an array of bytes from the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to read the bytes.

dst:byte[]

The output byte array to place the data.

off:int

The offset within the byte array to start copying.

len:int

The length of data to read.

getback to summary
public void get(long offset, short[] dst, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Doc from org.jruby.ext.ffi.MemoryIO.get.

Reads an array of shorts from the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to read the shorts.

dst:short[]

The output array to place the data in.

off:int

The offset within the array to start copying.

len:int

The number of shorts to read.

getback to summary
public void get(long offset, int[] dst, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Doc from org.jruby.ext.ffi.MemoryIO.get.

Reads an array of ints from the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to read the ints.

dst:int[]

The output array to place the data in.

off:int

The offset within the array to start copying.

len:int

The number of ints to read.

getback to summary
public void get(long offset, long[] dst, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Doc from org.jruby.ext.ffi.MemoryIO.get.

Reads an array of longs from the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to read the longs.

dst:long[]

The output array to place the data in.

off:int

The offset within the array to start copying.

len:int

The number of longs to read.

getback to summary
public void get(long offset, float[] dst, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Doc from org.jruby.ext.ffi.MemoryIO.get.

Reads an array of floats from the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to read the floats.

dst:float[]

The output array to place the data in.

off:int

The offset within the array to start copying.

len:int

The number of floats to read.

getback to summary
public void get(long offset, double[] dst, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.get.

Doc from org.jruby.ext.ffi.MemoryIO.get.

Reads an array of doubles from the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to read the doubles.

dst:double[]

The output array to place the data in.

off:int

The offset within the array to start copying.

len:int

The number of doubles to read.

getAddressback to summary
public long getAddress(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getAddress.

Doc from org.jruby.ext.ffi.MemoryIO.getAddress.

Reads a pointer value at the specified offset within the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:long

A long value that represents the address.

getByteback to summary
public byte getByte(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getByte.

Doc from org.jruby.ext.ffi.MemoryIO.getByte.

Reads an 8 bit integer value from the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:byte

The 8 bit integer value read from offset

getDoubleback to summary
public double getDouble(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getDouble.

Doc from org.jruby.ext.ffi.MemoryIO.getDouble.

Reads a double value from the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:double

The double value read from offset

getFloatback to summary
public float getFloat(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getFloat.

Doc from org.jruby.ext.ffi.MemoryIO.getFloat.

Reads a float value from the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:float

The float value read from offset

getIntback to summary
public int getInt(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getInt.

Doc from org.jruby.ext.ffi.MemoryIO.getInt.

Reads a 32 bit integer value from the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:int

The 32 bit integer value read from offset

getLongback to summary
public long getLong(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getLong.

Doc from org.jruby.ext.ffi.MemoryIO.getLong.

Reads a 64 bit integer value from the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:long

The 64 bit integer value read from offset

getMemoryIOback to summary
public MemoryIO getMemoryIO(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getMemoryIO.

Doc from org.jruby.ext.ffi.MemoryIO.getMemoryIO.

Reads a pointer value at the specified offset within the memory area, and wraps it in an abstract memory accessor.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:MemoryIO

A DirectMemoryIO accessor that can be used to access the memory pointed to by the address.

getNativeLongback to summary
public long getNativeLong(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getNativeLong.

Doc from org.jruby.ext.ffi.MemoryIO.getNativeLong.

Reads a native long integer value from the memory area.

A native long is 32bits on either ILP32 or LLP64 architectures, and 64 bits on an LP64 architecture.

This means that it will always read a 32bit value on Windows, but on Unix systems such as MacOS or Linux, it will read a 32bit value on 32bit systems, and a 64bit value on 64bit systems.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:long

The native long value read from offset

getShortback to summary
public short getShort(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getShort.

Doc from org.jruby.ext.ffi.MemoryIO.getShort.

Reads a 16 bit integer value from the memory area.

Parameters
offset:long

The offset within the memory area to read the value.

Returns:short

The 16 bit integer value read from offset

getZeroTerminatedByteArrayback to summary
public byte[] getZeroTerminatedByteArray(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.getZeroTerminatedByteArray.

Doc from org.jruby.ext.ffi.MemoryIO.getZeroTerminatedByteArray.

Reads a zero terminated byte array (e.g. an ascii or utf-8 string)

Parameters
offset:long

The offset within the memory area of the start of the string.

Returns:byte[]

A byte array containing a copy of the data.

getZeroTerminatedByteArrayback to summary
public byte[] getZeroTerminatedByteArray(long offset, int maxlen)

Implements abstract org.jruby.ext.ffi.MemoryIO.getZeroTerminatedByteArray.

Doc from org.jruby.ext.ffi.MemoryIO.getZeroTerminatedByteArray.

Reads a zero terminated byte array (e.g. an ascii or utf-8 string)

Parameters
offset:long

The offset within the memory area of the start of the string.

maxlen:int

The maximum length to search for the zero byte terminator.

Returns:byte[]

A byte array containing a copy of the data.

indexOfback to summary
public int indexOf(long offset, byte value)

Implements abstract org.jruby.ext.ffi.MemoryIO.indexOf.

Doc from org.jruby.ext.ffi.MemoryIO.indexOf.

Gets the first index within the memory area of a particular 8 bit value.

Parameters
offset:long

The offset within the memory area to start searching.

value:byte

The value to search for.

Returns:int

The index of the value, relative to offset.

indexOfback to summary
public int indexOf(long offset, byte value, int maxlen)

Implements abstract org.jruby.ext.ffi.MemoryIO.indexOf.

Doc from org.jruby.ext.ffi.MemoryIO.indexOf.

Gets the first index within the memory area of a particular 8 bit value.

Parameters
offset:long

The offset within the memory area to start searching.

value:byte

The value to search for.

Returns:int

The index of the value, relative to offset.

orderback to summary
public ByteOrder order()

Implements abstract org.jruby.ext.ffi.MemoryIO.order.

Doc from org.jruby.ext.ffi.MemoryIO.order.

Gets the ByteOrder this MemoryIO instance will read/write values to memory in.

Returns:ByteOrder

The current ByteOrder

putback to summary
public void put(long offset, byte[] src, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Doc from org.jruby.ext.ffi.MemoryIO.put.

Writes an array of bytes to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to start writing the bytes.

src:byte[]

The byte array to write to the memory area.

off:int

The offset within the byte array to start copying.

len:int

The length of data to write.

putback to summary
public void put(long offset, short[] src, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Doc from org.jruby.ext.ffi.MemoryIO.put.

Writes an array of shorts to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to start writing the shorts.

src:short[]

The array to write to the memory area.

off:int

The offset within the array to start copying.

len:int

The number of shorts to write.

putback to summary
public void put(long offset, int[] src, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Doc from org.jruby.ext.ffi.MemoryIO.put.

Writes an array of ints to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to start writing the ints.

src:int[]

The array to write to the memory area.

off:int

The offset within the array to start copying.

len:int

The number of ints to write.

putback to summary
public void put(long offset, long[] src, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Doc from org.jruby.ext.ffi.MemoryIO.put.

Writes an array of longs to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to start writing the longs.

src:long[]

The array to write to the memory area.

off:int

The offset within the array to start copying.

len:int

The number of longs to write.

putback to summary
public void put(long offset, float[] src, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Doc from org.jruby.ext.ffi.MemoryIO.put.

Writes an array of floats to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to start writing the floats.

src:float[]

The array to write to the memory area.

off:int

The offset within the array to start copying.

len:int

The number of floats to write.

putback to summary
public void put(long offset, double[] src, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.put.

Doc from org.jruby.ext.ffi.MemoryIO.put.

Writes an array of doubles to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to start writing the doubles.

src:double[]

The array to write to the memory area.

off:int

The offset within the array to start copying.

len:int

The number of doubles to write.

putAddressback to summary
public void putAddress(long offset, long value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putAddress.

Doc from org.jruby.ext.ffi.MemoryIO.putAddress.

Writes a pointer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:long

The pointer value to write to the memory location.

putByteback to summary
public void putByte(long offset, byte value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putByte.

Doc from org.jruby.ext.ffi.MemoryIO.putByte.

Writes an 8 bit integer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:byte

The 8 bit integer value to write to the memory location.

putDoubleback to summary
public void putDouble(long offset, double value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putDouble.

Doc from org.jruby.ext.ffi.MemoryIO.putDouble.

Writes a 64 bit float value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:double

The 64 bit float value to write to the memory location.

putFloatback to summary
public void putFloat(long offset, float value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putFloat.

Doc from org.jruby.ext.ffi.MemoryIO.putFloat.

Writes a 32 bit float value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:float

The 32 bit float value to write to the memory location.

putIntback to summary
public void putInt(long offset, int value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putInt.

Doc from org.jruby.ext.ffi.MemoryIO.putInt.

Writes a 32 bit integer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:int

The 32 bit integer value to write to the memory location.

putLongback to summary
public void putLong(long offset, long value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putLong.

Doc from org.jruby.ext.ffi.MemoryIO.putLong.

Writes a 64 bit integer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:long

The 64 bit integer value to write to the memory location.

putMemoryIOback to summary
public void putMemoryIO(long offset, MemoryIO value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putMemoryIO.

Doc from org.jruby.ext.ffi.MemoryIO.putMemoryIO.

Writes a pointer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:MemoryIO

The pointer value to write to the memory location.

putNativeLongback to summary
public void putNativeLong(long offset, long value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putNativeLong.

Doc from org.jruby.ext.ffi.MemoryIO.putNativeLong.

Writes a native long integer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:long

The native long integer value to write to the memory location.

putShortback to summary
public void putShort(long offset, short value)

Implements abstract org.jruby.ext.ffi.MemoryIO.putShort.

Doc from org.jruby.ext.ffi.MemoryIO.putShort.

Writes a 16 bit integer value to the memory area at the specified offset.

Parameters
offset:long

The offset within the memory area to write the value.

value:short

The 16 bit integer value to write to the memory location.

putZeroTerminatedByteArrayback to summary
public void putZeroTerminatedByteArray(long offset, byte[] bytes, int off, int len)

Implements abstract org.jruby.ext.ffi.MemoryIO.putZeroTerminatedByteArray.

Doc from org.jruby.ext.ffi.MemoryIO.putZeroTerminatedByteArray.

Writes a byte array to memory, and appends a zero terminator

Parameters
offset:long

The offset within the memory area of the start of the string.

bytes:byte[]

The byte array to write to the memory.

off:int

The offset with the byte array to start copying.

len:int

The number of bytes of the byte array to write to the memory area. (not including zero byte)

setMemoryback to summary
public void setMemory(long offset, long size, byte value)

Implements abstract org.jruby.ext.ffi.MemoryIO.setMemory.

Doc from org.jruby.ext.ffi.MemoryIO.setMemory.

Sets the contents of the memory area to the value.

Parameters
offset:long

The offset within the memory area to start writing.

size:long

The number of bytes to set to the value.

value:byte

The value to set each byte to.

sliceback to summary
public MemoryIO slice(long offset)

Implements abstract org.jruby.ext.ffi.MemoryIO.slice.

Doc from org.jruby.ext.ffi.MemoryIO.slice.

Creates a new MemoryIO pointing to a subset of the memory area of this MemoryIO.

Parameters
offset:long

The offset within the existing memory area to start the new MemoryIO at.

Returns:MemoryIO

A MemoryIO instance.

sliceback to summary
public MemoryIO slice(long offset, long size)

Implements abstract org.jruby.ext.ffi.MemoryIO.slice.

Doc from org.jruby.ext.ffi.MemoryIO.slice.

Creates a new MemoryIO pointing to a subset of the memory area of this MemoryIO.

Parameters
offset:long

The offset within the existing memory area to start the new MemoryIO at.

size:long

The size of the new slice.

Returns:MemoryIO

A MemoryIO instance.