Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6853301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:29:45+00:00 2026-05-27T01:29:45+00:00

say if I have a big ShortBuffer with only 5 relevant items starting at

  • 0

say if I have a big ShortBuffer with only 5 relevant items starting at position 0, and a small buffer with less capacity than the big buffer…
How would I ‘put’ the 5 values from the big buffer into the small buffer without getting a buffer overflow or having to manually index all of them?

currently throwing a buffer overflow exception with this:

indexBuffer.position(0);
subMeshes.get(subMeshIndex).indexBuffer.position(0);
subMeshes.get(subMeshIndex).indexBuffer.put(indexBuffer);

edit:
also please note that I’ll need to change the data from the large buffer afterwards so shared memory options like duplicate etc. are off the table

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:29:46+00:00Added an answer on May 27, 2026 at 1:29 am

    If I am understanding your needs correctly, the easiest thing to do would be to set a limit on the larger buffer. When you do a bulk put it will only transfer up to limit items. You can do this by:

    indexBuffer.position(0);
    indexBuffer.limit(5); // <-- limit to 5 temporarily
    subMeshes.get(subMeshIndex).indexBuffer.position(0);
    subMeshes.get(subMeshIndex).indexBuffer.put(indexBuffer);
    indexBuffer.limit( indexBuffer.capacity() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big file transfer (say 4gb or so) and rather than using
Let's say we have a big read only list of (int, string) elements. What
I have a big image that has to go in the background. Say the
I'm trying to foresee how big my database will be. Let's say I have
I have a small webshop-like web application, and i have big plans :-) I
Let's say you have a big web app with large visits, but you don't
Lets say I have a really big table filled with lots of data (say,
let's say we have 2 big list or stream of data and we want
I have a big object say MyApplicationContext which keeps information about MyApplication such as
Say I have a big file in one directory and an older version of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.