| | |
Java bitwise operation
![]() |
•
•
Join Date: Nov 2008
Posts: 63
Reputation:
Solved Threads: 4
0
#2 19 Days Ago
cast your IP address as a string if it isn't already. Cast your ints as Int objects, then you'll just need to concatenate them:
Is that what you are asking?
Java Syntax (Toggle Plain Text)
Integer one = integerone //your initial value; Integer two = integertwo Integer three = integerthree String myChunk = ipstring.concat(all of your Ints to strings);
•
•
Join Date: Nov 2008
Posts: 63
Reputation:
Solved Threads: 4
0
#4 19 Days Ago
•
•
•
•
hi eggmatters, thanks for your reply.
but that is not what i am looking for..
this involves some kind of biwise operation.
everything together should become a 16byte string.
Could you be more specific about how your data is typed? is it all character arrays? is it that you need to convert your ints to bytes? Do you want to convert all of your data into a hexidecimal string? Do you have sample code or some type of data structure that you can provide?
•
•
Join Date: Sep 2008
Posts: 1,561
Reputation:
Solved Threads: 196
0
#5 19 Days Ago
By bit operation I think he literally means an operation that directly operates on/manipulates bits. Although the only way I see to do this is to set aside an array of that many bits (via creating an array of 4 integers, which are 32 bits each in Java), then by using some specific operation such as OR (where each int in the array was initialized to 0). Probably not the solution he wants though.
Out.
•
•
Join Date: Nov 2009
Posts: 4
Reputation:
Solved Threads: 0
0
#6 19 Days Ago
i think the issue here is how to create a 16byte string.
this forms a 16byte string.
he is trying to club 32bit ip number & other 3 integers together a string like the above said.
16 letters in the string should represent all the 4 values.
i think, this is what he is looking for....
java Syntax (Toggle Plain Text)
String testString = "quickbrownfoxjum";
this forms a 16byte string.
he is trying to club 32bit ip number & other 3 integers together a string like the above said.
16 letters in the string should represent all the 4 values.
i think, this is what he is looking for....
![]() |
Similar Threads
- Enquiries about Bitwise operators (C++)
- plz help me how to create IDE in java (Java)
- Need Help In Decoder Programming (C++)
- Data Structure question (C++)
- Signal Processing: Hadamard Matrices (C)
Other Threads in the Java Forum
- Previous Thread: hey guys...can someone help me??
- Next Thread: help!
| Thread Tools | Search this Thread |
.net 3d add advice ajax apple applet automation balls bi bidirectional binary build businessintelligence buyouts c++ card character class code codesnippet collections component database deploy derby design development developmenthelp eclipse encryption error firefox fractal ftp game givemetehcodez google grails gui guidancer html idea image images infosec integer java javadesktopapplications javafx jetbrains jni julia linux listbox loop main method microsoft microsystems myregfun mysql netbeans newbie open-source oracle osx plazmic problem programming projectideas python qanda qt reference reporting rodjohnson ruby scanner se search security sell set size software sort sorting sql sun superclass support swing testautomation threads tree web websites whileloop windows







