-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbyteFunc.java
More file actions
28 lines (23 loc) · 807 Bytes
/
byteFunc.java
File metadata and controls
28 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
int[] solutionArray = s.getIntegerEncodedBytes();
System.out.println("Unsigned Byte Decode is: ");
for(int sl = 0;sl<solutionArray.length;sl++){
System.out.print(" ");
System.out.print(solutionArray[sl]);
}
System.out.println("\nConverted to 255 byte is: ");
for(int i=0;i<solutionArray.length;i++){
solutionArray[i] = (solutionArray[i] & 0xff);
//iBytes[i] = (iBytes[i] & 0xff);
System.out.print(" ");
System.out.print(solutionArray[i]);
}
byte[] b = new byte[solutionArray.length];
for(int i=0;i<b.length;i++){
b[i] = (byte)solutionArray[i];
}
System.out.println("\nUnsigned Byte Decode is: ");
for(int i=0;i<b.length;i++){
solutionArray[i] = b[i];
System.out.print(" ");
System.out.print(solutionArray[i]);
}