Results 1 to 3 of 3
- 12-08-2009, 04:59 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 43
- Rep Power
- 0
Bitwise operation syntax not recognized?
Hello, I'm using Eclipse and I wrote this code:
...and my IDE dose not rocognize the the << operation, giving an error.Java Code:int dataLength = 0; Byte[] length = {wavFile[findData], wavFile[findData+1], wavFile[findData+2],wavFile[findData+3]}; for(int i = 0; i < length.length; i++) { dataLength<<8; dataLength = dataLength | length[i]; }
Everywhere I look it says thats how you do a bitwise leftshift on an int.
Does anyone know why this is not working for me?
What I am trying to so is suppose I have 4 bytes:
00110011 00000000 10101010 00001111
I am trying to create the integer with the bit value
00110011000000001010101000001111
Thank You
- 12-08-2009, 05:02 AM #2
Member
- Join Date
- Nov 2008
- Posts
- 43
- Rep Power
- 0
errr I guess i would need a long type if i want 4 bytes but still same problem
- 12-08-2009, 05:17 AM #3
Member
- Join Date
- Nov 2008
- Posts
- 43
- Rep Power
- 0
Similar Threads
-
Confusing with bitwise NOT operator
By Willi in forum New To JavaReplies: 4Last Post: 10-16-2009, 11:06 PM -
XOR operation on bytes
By divyanshu023 in forum New To JavaReplies: 1Last Post: 09-17-2009, 07:11 PM -
Bitwise operations with long
By NewJavaBean in forum New To JavaReplies: 2Last Post: 04-07-2009, 07:37 PM -
Using the bitwise operators
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:39 PM -
Frame close operation
By Java Tip in forum Java TipReplies: 0Last Post: 12-21-2007, 08:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks