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

  • Home
  • SEARCH
  • 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 8148173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:35:44+00:00 2026-06-06T14:35:44+00:00

As we all know java allows us to use byte array as a buffer

  • 0

As we all know java allows us to use byte array as a buffer for data. My case here is with J2me

The scenario here is that I have two buffers of equal size and I need to swap them as they get full one by one ..

In detail
Two buffers buff1 and buff2

Reading data from Buff1 while writing other data to buff2

Then when buff2 gets full

They swap their position now reading from buff2 and writing to buff1

The above cycle goes on

So how do I detect when a buffer is full and is ready to be swapped?

  • 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-06-06T14:35:46+00:00Added an answer on June 6, 2026 at 2:35 pm

    so how do I detect when a buffer is full

    The buffer itself is never full (or empty). It is just a fixed amount of reserved memory.

    You need to keep track of the useful parts (i.e. those with meaningful data) yourself. Usually, this is just an integer that counts how much bytes were written into the buffer (starting from the beginning).

    When that integer reaches the buffer length, your buffer is “full”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that in java that we use *(asterisk) to import all the contents
We all know of sleep method available in java threads.. I understand that the
I know that Java enforce the programmer to list all exceptions that will be
I have a background of programming in Java and C++, so I know all
As you know, in a java interface, all methods have to be defined as
As we all know Java program will start executing from the public static void
As you maybe know, as Java language perspective all method in C# are final
We all know that openId has become such a popular method for user authentication,
We all know that CSS sprite images are great to reduce the amount of
All, I'm working on a java webapp that we deploy in the Resin web

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.