Example #1
0
	/*
	 *  Checking if the input Binary is particular Array2D.
	 *  Particular Array2D is a Binary data that starts with 512 byte data of
	 * all value that is 0xff.
	 *  Notice: Particular Array2D's size is not 512 byte. I misunderstood it.
	 *  http://twitter.com/rgssws4m told me about this case.
	 */
		bool Array2D::isInvalidArray2D(Binary const& b)
		{
			static unsigned const PARTICULAR_DATA_SIZE = 512;
		// check the data size
			if( b.size() < PARTICULAR_DATA_SIZE ) return false;
		// check the data inside Binary
			for(unsigned i = 0; i < PARTICULAR_DATA_SIZE; i++) if(b[i] != 0xff) return false;

			debug::Tracer::printBinary(b, clog);
		// return true if it is particular Array2D
			return true;
		}
Example #2
0
			virtual unsigned size() const { return binary_.size(); }
Example #3
0
			void set(Binary const& b) { setBER( b.size() ); write(b); }