Package org.jruby.ext.ffi

Examples of org.jruby.ext.ffi.ArrayMemoryIO.arrayLength()


        public boolean requiresPostInvoke() {
            return false;
        }
        private static final void addBufferParameter(InvocationBuffer buffer, IRubyObject parameter, int flags) {
            ArrayMemoryIO memory = (ArrayMemoryIO) ((Buffer) parameter).getMemoryIO();
                buffer.putArray(memory.array(), memory.arrayOffset(), memory.arrayLength(),
                        flags & bufferFlags((Buffer) parameter));
        }
        private static final long getAddress(Pointer ptr) {
            return ((DirectMemoryIO) ptr.getMemoryIO()).getAddress();
        }
View Full Code Here


                        buffer.setStructReturn(new byte[type.getNativeSize()], 0);
                    }

                } else if (memory instanceof ArrayMemoryIO) {
                    ArrayMemoryIO arrayMemory = (ArrayMemoryIO) memory;
                    if (arrayMemory.arrayLength() < type.getNativeSize()) {
                        throw runtime.newRuntimeError("size of struct returned from callback too small");
                    }

                    buffer.setStructReturn(arrayMemory.array(), arrayMemory.arrayOffset());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.