protected static long decodeLengthOld(byte[] input, int off, int len)
			throws IOException {
		if (len == 1) {
			return input[off] & 0xFF;
		} else if (len == 2) {
			return ((input[off] & 0xFF) << 8) | (input[off + 1] & 0xFF);
		} else if (len == 4) {
			return (((long) (input[off] & 0xFF)) << 24)
					| (((long) (input[off + 1] & 0xFF)) << 16)
					| (((long) (input[off + 2] & 0xFF)) << 8)
					| ((long) (input[off + 3] & 0xFF));
		}
		// undetermined size
		return -1;
	}