⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 g.java

📁 2009-PICA最新j2ME源码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
			abyte0 = bytearrayoutputstream.toByteArray();
		}
		datainputstream = a(s1, s2, abyte0, false);
                System.out.println("成功!!");
		int i1 = 0;
		byte abyte1[] = null;
		if (q > 0)
		{
			abyte1 = new byte[q];
			datainputstream.readFully(abyte1);
		} else
		{
			int j1 = 1024;
			abyte1 = new byte[1024];
			do
			{
				int k1;
				if ((k1 = datainputstream.read()) == -1)
					break;
				abyte1[i1] = (byte)k1;
				if (++i1 == j1)
				{
					byte abyte2[] = new byte[j1 += 1024];
					System.arraycopy(abyte1, 0, abyte2, 0, i1);
					abyte1 = abyte2;
				}
			} while (true);
		}
		String s4;
		s5 = s4 = new String(abyte1, 0, q <= 0 ? i1 : q, "UTF-8"); 
		if (datainputstream != null)
			try
			{
				datainputstream.close();
			}
			catch (Exception  e) { }
		try
		{
			bytearrayoutputstream.close();
		}
		catch (Exception  e) { }
		try
		{
			dataoutputstream.close();
		}
		catch (Exception  e) { }
		return s5;
//		JVM INSTR dup ;
//		Object obj;
//		obj;
//		throw ;
//		JVM INSTR dup ;
//		obj;
//		printStackTrace();
//		if (datainputstream != null)
//			try
//			{
//				datainputstream.close();
//			}
//			catch (Exception  e) { }
//		try
//		{
//			bytearrayoutputstream.close();
//		}
//		catch (Exception  e) { }
//		try
//		{
//			dataoutputstream.close();
//		}
//		catch (Exception  e) { }
//		break MISSING_BLOCK_LABEL_324;
//		Exception exception;
//		exception;
//		if (datainputstream != null)
//			try
//			{
//				datainputstream.close();
//			}
//			catch (Exception  e) { }
//		try
//		{
//			bytearrayoutputstream.close();
//		}
//		catch (Exception  e) { }
//		try
//		{
//			dataoutputstream.close();
//		}
//		catch (Exception  e) { }
//		throw exception;
//		return null;
	}

	private void a(String s1, String s2, ByteArrayOutputStream bytearrayoutputstream)
	{
            try{
                // Object obj = null;
                    DataInputStream datainputstream = a(s1, s2, bytearrayoutputstream.toByteArray(), true);
                    Object aobj[];
                    (aobj = new Object[2])[0] = datainputstream;
                    aobj[1] = new Integer(q);
                   //处理返回的消息函数,包括网页和,jabberd消息
                    a.a(6, ((Object) (aobj)));
                } catch (Exception ex) {
                    ex.printStackTrace();
                    a.a(7, null);
                }
////		return;
////		JVM INSTR dup ;
////		Exception exception;
////		exception;
////		printStackTrace();
//		a.a(7, null);
		return;
	}

	private DataInputStream a(String s1, String s2, byte abyte0[], boolean flag)
		throws Exception
	{
		DataOutputStream dataoutputstream;
		d = null;
		dataoutputstream = null;
		Object obj = null;
		String s3 = b.g ? "http://10.0.0.172:80" + s2 : "http://" + s1 + s2;
               
		d = (HttpConnection)Connector.open(s3, 3, true);
		d.setRequestMethod(abyte0 == null ? "GET" : "POST");
		d.setRequestProperty("X-Online-Host", s1);
		if (abyte0 != null)
			if (flag)
				d.setRequestProperty("Content-Type", "application/octet-stream");
			else
				d.setRequestProperty("Content-Type", "text/xml");
		d.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
		if (flag)
			d.setRequestProperty("Pica-Auth", b.a + "/" + b.b);
		else
		if (abyte0 != null)
			d.setRequestProperty("Content-Length", "" + abyte0.length);
		if (abyte0 != null)
		{
			dataoutputstream = d.openDataOutputStream();
			if (flag)
				dataoutputstream.write(abyte0);
			else
				dataoutputstream.write(abyte0, 2, abyte0.length - 2);
		}
		Object obj1;
		if (d.getResponseCode() != 200)
			throw new Exception("invalid response,code:" + d.getResponseCode());
		q = (int)d.getLength();
		DataInputStream datainputstream;
		obj1 = datainputstream = d.openDataInputStream();
		if (dataoutputstream != null)
			try
			{
				dataoutputstream.close();
			}
			catch (Exception  e) { }
		if (d != null)
			try
			{
				d.close();
			}
			catch (Exception  e) { }
		d = null;
                
		return ((DataInputStream) (obj1));
//		JVM INSTR dup ;
//		obj1;
//		throw ;
//		Exception exception;
//		exception;
//		h.i.append(exception.toString() + "\n");
//		exception.printStackTrace();
//		throw exception;
//		Exception exception1;
//		exception1;
//		if (dataoutputstream != null)
//			try
//			{
//				dataoutputstream.close();
//			}
//			catch (Exception  e) { }
//		if (d != null)
//			try
//			{
//				d.close();
//			}
//			catch (Exception  e) { }
//		d = null;
//		throw exception1;
	}

	private static String l(String s1)
	{
		StringBuffer stringbuffer = new StringBuffer();
		for (int i1 = 0; i1 < s1.length(); i1++)
		{
			char c1;
			switch (c1 = s1.charAt(i1))
			{
			case 60: // '<'
				stringbuffer.append("&lt;");
				break;

			case 62: // '>'
				stringbuffer.append("&gt;");
				break;

			case 38: // '&'
				stringbuffer.append("&amp;");
				break;

			case 39: // '\''
				stringbuffer.append("&apos;");
				break;

			case 34: // '"'
				stringbuffer.append("&quot;");
				break;

			default:
				stringbuffer.append(c1);
				break;
			}
		}

		if (stringbuffer.length() > 0)
			return stringbuffer.toString();
		else
			return "";
	}

	private void h(String s1, String s2, String s3)
	{
		synchronized (g)
		{
			g.addElement(((Object) (new Object[] {
				s1, s2, s3
			})));
		}
	}
//拼网页连入消息对像
	public final void a(String s1, Vector vector, short aword0[])
	{
		try
		{
			ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
			DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);
			if (aword0 != null)
			{
				String s2 = "j2meV0.1";
				String s3 = "png";
				String s4 = "amr;midi;wav";
				String s5 = (String)b.q()[0];
				int l1 = 24 + s2.getBytes("UTF-8").length + 2 + s3.getBytes("UTF-8").length + 2 + s4.getBytes("UTF-8").length + 2 + s5.getBytes("UTF-8").length;
				dataoutputstream.writeShort(1);
				dataoutputstream.writeInt(l1);
				dataoutputstream.writeByte(1);
				dataoutputstream.writeShort(2);
				dataoutputstream.writeUTF(s2);
				dataoutputstream.writeShort(aword0[0]);
				dataoutputstream.writeShort(aword0[1]);
				dataoutputstream.writeShort(aword0[2]);
				dataoutputstream.writeShort(aword0[3]);
				dataoutputstream.writeByte(aword0[4]);
				dataoutputstream.writeByte(aword0[5]);
				dataoutputstream.writeByte(255);
				dataoutputstream.writeUTF(s3);
				dataoutputstream.writeUTF(s4);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(1);
				dataoutputstream.writeByte(1);
				dataoutputstream.writeByte(1);
				dataoutputstream.writeByte(1);
				dataoutputstream.writeUTF(s5);
			}
			boolean flag = false;
			dataoutputstream.writeShort(2);
			if (vector != null)
			{
				int i1 = 0;
				for (int j1 = 0; j1 < vector.size(); j1++)
					i1 = ((String[])vector.elementAt(j1))[0].getBytes("UTF-8").length + 2 + ((String[])vector.elementAt(j1))[1].getBytes("UTF-8").length + 2 + 1;

				dataoutputstream.writeInt(8 + i1 + s1.getBytes("UTF-8").length + 2);
				dataoutputstream.writeByte(1);
				dataoutputstream.writeUTF(s1);
				dataoutputstream.writeInt(1000);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(vector.size());
				for (int k1 = 0; k1 < vector.size(); k1++)
				{
					dataoutputstream.writeUTF(((String[])vector.elementAt(k1))[0]);
					dataoutputstream.writeByte(0);
					dataoutputstream.writeUTF(((String[])vector.elementAt(k1))[1]);
				}

			} else
			{
				dataoutputstream.writeInt(8 + s1.getBytes("UTF-8").length + 2);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeUTF(s1);
				dataoutputstream.writeInt(1000);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(0);
				dataoutputstream.writeByte(0);
			}
			a("", bytearrayoutputstream);
                       // a("","", bytearrayoutputstream);
			return;
		}
		catch (Exception  e)
		{
			return;
		}
	}
//组装发送消息对像
	private void a(String s1, ByteArrayOutputStream bytearrayoutputstream)
	{
		synchronized (g)
		{
			g.addElement(((Object) (new Object[] {
				s1, bytearrayoutputstream
			})));
		}
	}

	private void m() throws InterruptedException, Exception
	{
		long l1 = System.currentTimeMillis(); 
		Object aobj[] = null;
                while(true){//新加
		if (k || j && g.isEmpty())
			break; /* Loop/switch isn't completed */
		aobj = null;
		if (!g.isEmpty()) 
			synchronized (g)
			{
				aobj = (Object[])g.firstElement();
				g.removeElementAt(0);
			}
		else
		if (!j){ 
			if (System.currentTimeMillis() - l1 > (long)o || !p)
			{
				aobj = (new Object[] {
					"cache", "/cache.xml", null
				});
				if (b.i == 3)
				{
					if (p && n < pica.core.e.a.length - 1)
						n++;
					if (!p)
						n = 0;
					o = pica.core.e.a[n] * 1000;
				}
				l1 = System.currentTimeMillis();
			} else
			{
				Thread.sleep(2000);
			}
                }
 		if (aobj != null){            
                    if (aobj.length == 3)
                    {       
                            f((String)aobj[0], (String)aobj[1], (String)aobj[2]);
                            if (!((String)aobj[0]).startsWith("cache"))
                            {
                                    if (b.i != 3)
                                    {
                                            n = 0;
                                            o = pica.core.e.a[n] * 1000;
                                    }
                                    l1 = System.currentTimeMillis() - (long)(o - 4000);
                            }
                            if (aobj[0].equals("logout"))
                                    return; 
                    }
                    if (aobj.length == 2) 
                            a(m, (String)aobj[0], (ByteArrayOutputStream)aobj[1]);
                }
                Thread.yield();//
                Thread.sleep(500);//休息一秒
               }
                   System.out.println("exit44");
//		continue; /* Loop/switch isn't completed */
//		JVM INSTR dup ;
//		Exception exception;
//		exception;
//		getMessage();
//		JVM INSTR dup ;
//		String s1;
//		s1;
//		JVM INSTR ifnull 375;
//		   goto _L1 _L2
//_L1:
//		break MISSING_BLOCK_LABEL_364;
//_L2:
//		break MISSING_BLOCK_LABEL_375;
//		if (s1.equals("disconnected"))
//			break MISSING_BLOCK_LABEL_391;
		if (aobj == null || !aobj[0].equals("logout"))
                    return;//break MISSING_BLOCK_LABEL_392;
		//return;
		if (l)
		{
			l = false;
			return;
		}
		Object aobj1[];
		if (aobj != null && !aobj[0].equals("cache"))
			synchronized (g)
			{
				if (g.size() > 0)
				{
					if ((aobj1 = (Object[])g.firstElement())[0].equals("login"))
						g.insertElementAt(((Object) (aobj)), 1);
				} else
				{
					g.insertElementAt(((Object) (aobj)), 0);
				}
			}
  
	}

	public final void h()
	{
		k = true;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -