Methodology Adopted: Architecture Diagram
Methodology Adopted: Architecture Diagram
Architecture diagram:
B) Byte: - The Byte class wraps a value of primitive type byte in an object. An object of type Byte contains a single field whose type is byte. In addition, this class provides several methods for converting a byte to a String and a String to a byte, as well as other constants and methods useful when dealing with a byte.
Algorithm Used
a) The length of the message is stored as a 4 byte number, or 32 bits, thus the message starts after 32 bytes of image. b) Since the first 32 bytes contain 1 bit each of our length, we must loop all 32 bytes to retrieve the length. c) We shift the bits of length left by 1, then OR it with a result of the least significant bit of the image byte. (& 1) will clear all bits, except the last bit, which will be left as is. Thus as bits are added, they are moved along and placed into the newly empty least significant slot of length. d) Now that we have a length and have created a byte array to hold the bits, we loop through that many image bytes. e) Again we must loop through the 8 bits of a byte to be collected. f) The resulting array of bytes is made up of the least significant bit of each sequential byte. This is retrieved in the same way as we retrieved the length, now that the loops are properly setup.