private void writeStringAMF0(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);
		}

		ret.add((byte)0x02);

		ret.add((byte)((temp.length & 0xFF00) >> 8));
		ret.add((byte)(temp.length & 0x00FF));

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