private void writeString(List<Byte> ret, String val) throws EncodingException
	{
		byte[] temp = null;
		try
		{
			temp = val.getBytes("UTF-8");
		}
		catch (UnsupportedEncodingException e)
		{
			throw new EncodingException("Unable to encode string as UTF-8: " + val);
		}

		writeInt(ret, (temp.length << 1) | 1);

		for (byte b : temp)
			ret.add(b);
	}