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 983317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:50:14+00:00 2026-05-16T04:50:14+00:00

in my project i am using popupscreen with GaugeField for http request.Currently we are

  • 0

in my project i am using popupscreen with GaugeField for http request.Currently we are just incrementing the value of gaugefield with fixed rate and after http response we just remove the popupscreen. so some times http request is completed when gauge field is in 40% or 60%.

But i want to synchronize gaugefield value with http request/responses. it means that popupscreen will always remove at 100%.

  • 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-16T04:50:15+00:00Added an answer on May 16, 2026 at 4:50 am

    I don’t have the code in front of me, but I something similar in a project several years ago.

    I wrote a subclass of InputStream that wrapped around the InputStream object I got back from openInputStream(), reimplementing all the read() methods so they would increment a counter with the number of bytes read. Whenever the counter reached a certain threshold, it would update a GaugeField object that was passed into the subclass’s constructor.

    So your subclass would look something like this:

    public GaugedInputStream extends InputStream
    {
        private InputStream _inputStream = null;
        private GaugeField _gaugeField = null;
        private int _counter = 0;
        private int _threshold = 0;
    
        public void GaugedInputStream(InputStream inputStream, GaugeField gaugeField)
        {
            _inputStream = inputStream;
            _gaugeField = gaugeField;
    
            ... other constructor stuff ...
        }
    
        public int read() 
        {
            int byte = _inputStream.read();
            increment(1);
            return byte;
        }
    
        public int read(byte[] b) 
        {
            int bytes = _inputStream.read(b);
            increment(bytes);
            return bytes;
        }
    
        public int read(byte[] b, int off, int len)  
        {
            int bytes = _inputStream.read(b, off, len);
            increment(bytes);
            return bytes;
        }
    
        ... override other InputStream methods here ...
    
        private void increment(int bytes)
        {
            _counter = _counter + bytes;
            _threshold = _threshold + bytes;
            updateGaugeIfNeeded();
        }
    
        private void updateGaugeIfNeeded()
        {
            if (_threshold > 100)
            {
                updateGauge();
                _threshold = 0;
            }
        }
    
        private void updateGauge()
        {
            ... code to update the gauge ...
        }
    }
    

    I’m leaving out a lot of the guts here, but I hope this sets you in the right direction.

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

Sidebar

Related Questions

i 'm doing a project using webview in android. i can't visit url: http://www.baidu.org
currently i have a project using solr,now i want to add some feature,so i'm
I have compiled a project using Eclipse with C/C++ plugin (using http://libcinder.org library, and
I'm building my project using the following POM: <project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd> <modelVersion>4.0.0</modelVersion>
The documentation of my project (using Python 3.2) is created with Sphinx (1.1.3) and
In a web project using jsp, I have following requirement Upload a file (say
i have a JavaScript project (using jquery), inside it i draw a canvas by
I write a project using Prism . I have tow modules and this modules
I have a lein project (using cascalog--but that's not particularly important). I'm trying to
I have a project using DynamicJasper to create reports. It works fine so far,

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.