public TypedObject decodeConnect(byte[] data) throws NotImplementedException, EncodingException
	{
		reset();

		dataBuffer = data;
		dataPos = 0;

		TypedObject result = new TypedObject("Invoke");
		result.put("result", decodeAMF0());
		result.put("invokeId", decodeAMF0());
		result.put("serviceCall", decodeAMF0());
		result.put("data", decodeAMF0());

		if (dataPos != dataBuffer.length)
			throw new EncodingException("Did not consume entire buffer: " + dataPos + " of " + dataBuffer.length);

		return result;
	}