Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: should i pass arrays or bytebuffers?

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default should i pass arrays or bytebuffers?

    I've noticed that in lwjgl, the functions which would require an array in opengl require bytebuffers or floatbuffers in lwjgl. is this for speed?

    i need to be able to pass an array to a function i've written, and return one.

    what would be faster, using a jbytearray, or converting my array to a buffer, sending it, having the method return a buffer, and converting it to an array?


  2. #2
    Junior Member
    Join Date
    Mar 2010
    Location
    Home-Ujjain /Job-Mumbai
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: should i pass arrays or bytebuffers?

    Hi,
    If you will try to passing array or buffer both means passing a object to a function and both will take same time. but if you will convert an array to buffer and send it and again get the buffer and convert it into the array, this will take time so now it depends upon you whatever you like.

    Regards
    Sunil
    Programmer

Similar Threads

  1. 'pass by value' and 'pass by reference'
    By pokuri in forum Object Oriented Programming
    Replies: 5
    Last Post: January 26th, 2011, 11:30 AM
  2. how to pass a variable from a method to another
    By amr in forum Java Theory & Questions
    Replies: 1
    Last Post: November 20th, 2010, 10:32 PM
  3. Can't pass to the other method
    By mingming8888 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 27th, 2010, 09:44 AM
  4. How do you pass an Array as a Parameter?
    By Arius in forum Java Theory & Questions
    Replies: 1
    Last Post: January 23rd, 2010, 09:36 PM
  5. How to Pass unlimited Arguments to a Function
    By neo_2010 in forum Java Code Snippets and Tutorials
    Replies: 2
    Last Post: July 8th, 2009, 11:39 AM