Results 1 to 2 of 2
Thread: XOR operation on bytes
- 09-17-2009, 06:55 PM #1
Member
- Join Date
- Sep 2009
- Posts
- 2
- Rep Power
- 0
XOR operation on bytes
I want to do a XOR operation on bytes.
I am using two bytes variable whose size is 16 bytes each
e.g byte[] buf = new byte[16]
byte[] buf1 = new byte[16]
can i do a XOR operation on the two byte variables
a statement like buf = buf ^ buf1 gives me an error.do i need to do XOR opearation on individual bytes??
- 09-17-2009, 07:11 PM #2
Yes, each byte.
Java Code:for( int i = 0; i < buf.length; i++ ) buf[i] = (byte)(buf[i] ^ buf1[i]);
My Hobby Project: LegacyClone
Similar Threads
-
Multiple window (java program) simultaneous operation
By shoeb83 in forum New To JavaReplies: 24Last Post: 12-03-2009, 10:58 PM -
Bit Wise operation: shifting
By rueter in forum New To JavaReplies: 1Last Post: 06-27-2009, 06:51 AM -
Help in building little text editor that perform the UNDO operation
By realahmed8 in forum New To JavaReplies: 6Last Post: 04-20-2009, 01:46 AM -
[Beginner]Eclipse RCP Undo/redo operation
By pollux in forum EclipseReplies: 2Last Post: 02-18-2009, 06: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