Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java
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++;
            }
        }
    }

Can any1 Please explain me the bold code.I know that the embed bytes is hiding data in 2 LSB.Can any1 please guide me to hide data in 1 LSB
Posted 3-Apr-12 5:47am
Comments
TorstenH. at 4-Apr-12 3:08am
   
where is that coming from? These are byte operations.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 200
1 Kornfeld Eliyahu Peter 175
2 BillWoodruff 160
3 George Jonsson 140
4 OriginalGriff 126


Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 3 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100