TLV Redux

Alright @adamvoncorswant, feel free to take a peek when you get a moment. Never before has there been such a test-covered parser :tada: 

FYI @linnie if you're interested. EMV stuff and all that.
I think it's more readable and the compiler will for sure remove it, but
reviewers always complain when I do it... will remove the shift.

On Mon, Dec 22, 2014 at 10:13 AM, Adam von Corswant <
notifications@github.com> wrote:
>
> In izettle-emv/src/main/java/com/izettle/tlv/TLVEncoder.java
> <https://github.com/iZettle/izettle-toolbox/pull/97#discussion-diff-22158789>
> :
>
> > +	 */
> > +	static byte[] encodeLength(int l) throws TLVException {
> > +
> > +		if(l < 0) {
> > +			throw new TLVException("Length less than zero");
> > +		}
> > +
> > +		byte[] out;
> > +
> > +		if (l > 0x00FFFFFF) {
> > +			out = new byte[5];
> > +			out[0] = (byte)0x84;
> > +			out[1] = (byte)((l >> 24) & 0xff);
> > +			out[2] = (byte)((l >> 16) & 0xff);
> > +			out[3] = (byte)((l >> 8) & 0xff);
> > +			out[4] = (byte)((l >> 0) & 0xff);
>
> Do you think that these statements add to readability (>> 0), or should
> be just remove them? They give warnings in my IDE :)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/iZettle/izettle-toolbox/pull/97/files#r22158789>.
>