public int getLength() {
		final long length;
		if (isString()) {
			length = getStringLength();
		} else if (!isArray() && !isObject()) {
			throw new VPackValueTypeException(ValueType.ARRAY, ValueType.OBJECT, ValueType.STRING);
		} else {
			final byte head = head();
			if (head == 0x01 || head == 0x0a) {
				// empty
				length = 0;
			} else if (head == 0x13 || head == 0x14) {
				// compact array or object
				final long end = NumberUtil.readVariableValueLength(vpack, start + 1, false);
				length = NumberUtil.readVariableValueLength(vpack, (int) (start + end - 1), true);
			} else {
				final int offsetsize = ObjectArrayUtil.getOffsetSize(head);
				final long end = NumberUtil.toLong(vpack, start + 1, offsetsize);
				if (head <= 0x05) {
					// array with no offset table or length
					final int dataOffset = findDataOffset();
					final VPackSlice first = new VPackSlice(vpack, start + dataOffset);
					length = (end - dataOffset) / first.getByteSize();
				} else if (offsetsize < 8) {
					length = NumberUtil.toLong(vpack, start + 1 + offsetsize, offsetsize);
				} else {
					length = NumberUtil.toLong(vpack, (int) (start + end - offsetsize), offsetsize);
				}
			}
		}
		return (int) length;
	}
public int getLength ( ) { final long length ; if ( isString ( ) ) { length = getStringLength ( ) ; } else if ( ! isArray ( ) && ! isObject ( ) ) { throw new VPackValueTypeException ( ValueType . ARRAY , ValueType . OBJECT , ValueType . STRING ) ; } else { final byte head = head ( ) ; if ( head == 0x01 || head == 0x0a ) { length = 0 ; } else if ( head == 0x13 || head == 0x14 ) { final long end = NumberUtil . readVariableValueLength ( vpack , start + 1 , false ) ; length = NumberUtil . readVariableValueLength ( vpack , ( int ) ( start + end - 1 ) , true ) ; } else { final int offsetsize = ObjectArrayUtil . getOffsetSize ( head ) ; final long end = NumberUtil . toLong ( vpack , start + 1 , offsetsize ) ; if ( head <= 0x05 ) { final int dataOffset = findDataOffset ( ) ; final VPackSlice first = new VPackSlice ( vpack , start + dataOffset ) ; length = ( end - dataOffset ) / first . getByteSize ( ) ; } else if ( offsetsize < 8 ) { length = NumberUtil . toLong ( vpack , start + 1 + offsetsize , offsetsize ) ; } else { length = NumberUtil . toLong ( vpack , ( int ) ( start + end - offsetsize ) , offsetsize ) ; } } } return ( int ) length ; }
@return the number of members for an Array, Object or String