byteOut= new ByteArrayOutputStream(); byteArrayIn= new byte[inputFileSize]; DataInputStream in= new DataInputStream(new FileInputStream(masterFile)); in.read(byteArrayIn, 0, inputFileSize); in.close(); byte tempByte[]= new byte[4]; for(i=24, j=0; i>=0; i-=8, j++) { tempInt= inputFileSize; tempInt>>= i; tempInt&= 0x000000FF; tempByte[j]= (byte) tempInt; } embedBytes(tempByte);
private static void embedBytes(byte[] bytes) { int size= bytes.length; for(int i=0; i< size; i++) { byte1= bytes[i]; for(int j=6; j>=0; j-=2) { byte2= byte1; byte2>>= j; byte2&= 0x03; byte3= byteArrayIn[inputOutputMarker]; byte3&= 0xFC; byte3|= byte2; byteOut.write(byte3); inputOutputMarker++; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)