public void encodeObject (Object anObject) {
		if (anObject == null) {
			encodeValue(new NullValue(null));
			return;
		}
		if (anObject instanceof Integer || anObject instanceof Long) {
			encodeValue(new IntegerValue(anObject));
		} else if (anObject instanceof Double || anObject instanceof Float) {
			encodeValue(new DoubleValue(anObject));
		} else if (anObject instanceof ArrayList) {
			encodeValue(new ArrayValue(anObject));
		} else if (anObject instanceof String) {
			encodeValue(new StringValue(anObject));
		} else if (anObject instanceof Map) {
			encodeValue(new MapValue(anObject));
		} else if (anObject instanceof ByteBuffer) {
			encodeValue(new DataValue(anObject));
		} else {
			throw new UnmatchedTypeException("Cannot encode objects of class: " + anObject.getClass().getName());
		}
	}