Browse Prior Art Database

Java Bit displayer

IP.com Disclosure Number: IPCOM000028027D
Original Publication Date: 2004-Apr-20
Included in the Prior Art Database: 2004-Apr-20
Document File: 1 page(s) / 45K

Publishing Venue

IBM

Abstract

Displaying a textual representation of bit fields dynamically in Java

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 1

Java Bit displayer

When communicating information across a network it is often most desirable to send as little information as possible as it takes a relatively long time for it to be transmitted. If a command or instruction is to be sent across a network then it may be sent with options to indicate specifically how the task should be done. True or false options are nearly always sent as single bits (although often grouped into bytes) where the bit turned off (0) indicates false, and the bit turned on (1) indicates true. Therefore, in 2 bytes you could send the status of any combination of 16 boolean options. Commonly, an application developer would create a constants file that has decimal values that map to turning the individual bits on and off and the options would be composed by or'ing the constants together.

    When writing software that is doing this, to check that the options are being transported correctly across the network, or to work out what the options were, the information can be traced when it is received. However, looking at a trace and seeing that the options specified were '28' or 0x1C does not really make instantly clear what options were specified. Even displaying the binary does not normally make things clearer as most constants are defined as decimal or hex. Hence, without a calculator and access to all the constants it is not immediately apparent what options were / were not set.

    Disclosed is a program for taking a number and displaying the options which are set on it. Using the Java programming language, working out what flags are se...