bit 2 « bit « Java Data Type Q&A





1. setting bits question    forums.oracle.com

I have a bunch of bytes of data I want to build in a byte array. I looked at BitSet but I dont' think does what I want. I'd like to be able to specify a start byte/bit, end byte/bit, along with the data I want to add. Ex. I'd like to be able to set the first 4 bits of ...

2. A bit of .gif help    forums.oracle.com

3. bits?    forums.oracle.com

bit - 1 off/on logic circut nyble - 4 bits byte - 8 bits word - 16 bits (ms def) lword - 32 bits (ms def) You can represent -127 to 127 in a byte, 256 possible combinations of bits to produce distinct patters. What byte do you have that is 128? Even if you are working on a 128 bit ...

4. A bit of humor    forums.oracle.com

5. Looking for java bit buffer class    forums.oracle.com

6. 8 bit format    forums.oracle.com

Ok thanks.. I am getting output like this after converting back to octal. String s = "54747A0E4ACF41F4F29C9E769F4121"; BigInteger b = new BigInteger(s,16); System.out.println("big int:"+b); String ans = b.toString(8); System.out.println("ans:"+ans); ans:2507217203445317203723624711716647640441 or can you tell me this? i have hex string and i want it in char format .. say string is like this.... D07C580E5AA641CB303B0D9A86C5A06519C44CE7CBA0253ACDA6A741CE303ACD520CD161346819968384E834081996838A6BD0105D2EEB41CD349B9E0639C3E8344B310D8FD16110341F968396E9793B4C074DCBA0669A4D0F8390E1344B010DCB41C8B01C545C83966F50303D4F8396E9793B4C0735D36C7A1AE40CA3D32E9782995E9741F5B9CB05DAB552 so when converted to 8 bit format ...

7. JAVAC vs JAVA for 32/64 bit    forums.oracle.com

I want to produce Java application for 64 bit architecture. What I am not sure, is do I need to compile it with javac for 64 bit or do I just need to change JVM option of java ? In other word, the compilation is not a problem (the byte code is always the same) and it is at run time, ...

8. Packing and Unpacking BITS from a SHORT    forums.oracle.com

The approach I use to encode the short value involves taking my input byte array and casting each into a short. Then I use the bitwise-right shift operator ( >> ) to move the bit value into the appropriate position. To apply the next byte-value I bitwise-OR the previous value onto the new mask. The values in the byte-array are assured ...

9. Homework check? little bit of help/checking    forums.oracle.com

Could you guys check up on my homework?? I think I have most of them right, but some I cannot figure out. Thanks for the help 7. What is the relationship of animal to bird in the following line of Java code: public class bird extends animal { a) bird overloads animal b) animal implements bird c) animal is a subclass ...





10. im a bit green, need help    forums.oracle.com

The program should prompt the user for the quantity of numbers in the list and for the numbers in the list. For example: Enter the quantity of numbers in the list: 10 Enter the list of 10 numbers 31 7 97 23 59 1 65 57 19 37 The output should look like this There are 10 numbers in the list. ...

11. Friday OT: It's all gone a bit Pete Tong    forums.oracle.com

12. How to work with bits?    forums.oracle.com

Hello everybody I need to work simple with some amount of bits. I will be diponse of some byte array(data buffer) which present some value to be stored in Java types. Therefore I need to extract or change concrete bitst from this buffer. For example I have 16byte(128bit) buffer. I extract 13 bits from 7th bit. Then those bits must be ...

13. Why Should I NOT Do This? Warning - A Bit of Code    forums.oracle.com

Hi, one thing about your DAO: you have the finally-block which calls close() on a ResultSet and a PreparedStatement. Apart from rs.close() being called twice, each of those calls may throw an SQLException. So, if rs.close() throws the Exception, statement will never be closed and the Connection will never be released. Similarly if statement.close() throws the Exception: your Connection will not ...

14. Extracting various bits of information from a string    forums.oracle.com

Hi, I am interested in extracting various pieces of information from strings (which were originally email bodies). For example email addresses (that are in the body of the email not the "from" field), phone numbers (which could have spaces between, international formats/conventions, ie not all numbers), profession (to match against a list I have), etc etc. I am expecting that I ...

15. Least Significant Bit removal    forums.oracle.com

16. C to Java bit shifting/masks    forums.oracle.com





17. Help working with bits!    forums.oracle.com

Hi all! First of all sorry, because my email is too long I'm trying to make read/write operations with bits but I'm going mad. That's my problem: I have a file called "doubles.bin" which stores numbers in double format and I need to read every data in that file, take a number of bits specified by the user and create a ...

18. Help!Working with bits    forums.oracle.com

Hi all! First of all sorry, because my email is too long I'm trying to make read/write operations with bits buy I'm going mad. That's my problem: I have a file called "doubles.bin" which stores numbers in double format and I need to read every data in that file, take a number of bits specified by the user and create a ...

19. Requesting a bit of help with my assignment - Pretty basic...    forums.oracle.com

How would I make the findLetterGrade() use what was calculated for the average is really all I need to put in there. "if(average >= 90)" That average needs to read what the average was in the findAverage(). Should I just make a new variable such as "private double average;" or is it possible to make the average I already have readable ...

20. how the bit operations work in this example...    forums.oracle.com

hexChar \[( b\[i\] & 0xf0 ) >>> 4\] and hexChar \[b\[i\] & 0x0f\] are using eg 0xf0 and 0x0f. so how would a byte which has eg "A" will get converted to its value of hex? and what exactly >>> is being used for...kinda step by step explanation would realy be greatful.

22. Java Hamming code: check bits    forums.oracle.com

23. Is it possible to do 8-bit communication of http?    forums.oracle.com

No. What I'm saying is that to do SFTP, I'd need to have every user have a unique login name and password, as well as defined space on the FS (ie can't just go in and delete other people's work) the way my app works now is just to use one account, but then people could delete (or download) other people's ...

24. Write a small bit of code...    forums.oracle.com

26. Another new kid in need of a TINY bit of help.    forums.oracle.com

Yes yes, because they are two different data types, no? Trying to assign an into to a string? Bah, I'm doing the same thing with a string and a char them >.< boo! My class hasn't learned arrays yet...the only reason I remeember them is because I took an intro class last year... Is there a way to just convert a ...

27. why would one strip the least significant bits when casting?    forums.oracle.com

Thanks (to both respondents.) It makes sense now. One the other end of things is a c++ app that is writing data to the socket I have open. It is probably writing an unsigned short, which I think C++ actually supports, right? Note that a "readShort" was used in DataInputStream. A "readUnsignedShort" could have eliminated the need for the code I ...

28. How to reverse bits (big endian to little endian)?    forums.oracle.com

Hi, I have a problem with some bits. I have two bytes (surprise surprise) with 12 bits (they are padded with four zeros). The bytes SHOULD look like this (x and n represent bits): | x n x n x n x n | x n x n 0 0 0 0 | However, they are coming in as such: | ...

29. Parsing Bit level data formats    forums.oracle.com

Oh, by the way, you may have to be careful about byte ordering. The readInt method of DataInputStream (and other classes that implement DataInput) assume the four bytes of an int are sent in big-endian fashion -- highest to lowest in byte order. Check to see if the bytes are being written in big-endian or in little-endian fashion.

30. how to save a string of 0's and 1's as bits    forums.oracle.com

31. how to write a single bit to an output device    forums.oracle.com

Im wondering if there is a way to write a single bit out to a physical device. The BitOutputStream can accept a single bit, but when it writes to the OutputStream, it appears to be handled as a byte. Even 2 bits gets stuffed into a byte and padded. Im trying to do some very high speed switching and want to ...

32. Decoding a 9 bit value in java    forums.oracle.com

33. Bit Packing in java    forums.oracle.com

Hi, Im using Java to do bit packing for an assignment. Ive got the compression working, but im having problems with decompression. The example im having problems with is: Ive packed an integer into 8 bits and it crosses a byte boundary. I.e. [1 _0110000][1_0010110]. The _ show the start and end of the character 01100001 (97) When I get the ...

34. A Bit Stuck!    forums.oracle.com

35. A Bit Stuck - Attempt 2    forums.oracle.com

36. How to grab a certain number of bits    forums.oracle.com

Hi, hmm, I still seem to be getting an error though (or a value that I am not expecting!). So this is what I am doing: q = (m_d2.getCardIntVal(j)>>>8)&0xFF; r = (m_d2.getCardIntVal(k)>>>8)&0xFF; s = q|r; System.out.println(... Ok, it seems fine, but when I examine the values I get this (printing out the output): Three of Spades 17 Ten of Spades 24 ...

37. HELP! How do you create a 8 bit png?    forums.oracle.com

38. Need a little bit of help with substring...    forums.oracle.com

Im very new at java programming, and need a bit of help with a problem: Here is what I have: System.out.print("Enter a string : "); Scanner scan = new Scanner (System.in); stringy = scan.nextLine(); Now I want to split the string "stringy" like this: h:hi:hip:hipp:hippo I know this uses substring, but I can't figure out how to do it. Any help ...

39. finding least signficant bits    forums.oracle.com

40. casting, need a bit help here.    forums.oracle.com

41. Create custom bit length objects    forums.oracle.com

Forgive my English if the title isn't self-explicative. Here's my problem: I'm writing a program in which I use long variables as containers for two 32-bit integers representing floats with Float.floatToIntBits(). Since a "long" is 64-bit long, it works, two 32-bit variables fit in. The problem is that I've realized that I need to represent 4 floats in a single variable, ...

42. I am a bit confused...    forums.oracle.com

well, it just started working. I think Type had a different value in some of the tests i was running than what i thought. I checked it a bunch of times when it didn't run, but now all of a sudden its working right. my problem is that i research stuff and then as soon as i post BOOM most of ...

43. Whats wrong with this bit of code?    forums.oracle.com

44. Just a bit philosophical    forums.oracle.com

I always find myself waxing just a little philosophical this time of year. New years is coming and I'm not getting any younger so I spend a bit more time looking back than I used to. On Thursday I came up with a very good concept a really spiffy way to express something that wasn't new in any way but it ...

45. What is wrong with this bit of code?    forums.oracle.com

46. Measuring bit rate from java...    forums.oracle.com

Presumably java is reading the data stream and displaying it? If so then you already KNOW how fast you are reading the data. Just add some instrumentation to the code that reads the data. If the video is not being played through java then you can't do it using pure java. matfud

47. Sending bit to a serial Device    forums.oracle.com

48. Bit reversed counter class - need help with under standing pseudo code    forums.oracle.com

I'm working on concurrent priority queue based on heap using algorithm proposed by Galen C. Hunt. Here is the paper which describes the algorithm: http://www.cs.rochester.edu/~scott/papers/1996_IPL_heaps.pdf The problem I find is understanding of structure called bit reversed counter - the pseudo code bellow. Could anyone please help and propose how to implement that counter in Java? structure bit_reversed_counter begin counter := 0 ...

49. return bits    forums.oracle.com

50. [A Bit Off Topic] Where to Share Java Code    forums.oracle.com

What do you mean by "share code"? If you want to provide your code for the public to use, make it open-source, and host it at a public source code hosting site, e.g. see a list of them here: http://en.wikipedia.org/wiki/Comparison_of_open_source_software_hosting_facilities If you mean ask for code, well, this forum is not the right place, obviously :o) Now if you mean, discuss ...