加载中…
  
博文
标签:

it

分类: JAVA
java的IO包当中提供了,向文件中写入文件和读取文件的方法。好吧,来看下具体怎么回事吧。我们先写一个像文件当中写单个对象的方法吧。 

  
public
标签:

it

分类: APK反编译原理

一个 ZIP 文件的普通格式

----------------------

    一个 ZIP 文件由三个部分组成:
        

标签:

杂谈

分类: JAVA
private static String byteArray2Hex(byte[] paramArrayOfByte)
  {
    Formatter localFormatter1 = new Formatter();
    int i = paramArrayOfByte.length;
    int j = 0;
    while (true)
    {
      if (j >= i)
        return localFormatter1.toString();
      byte b = paramArrayOfByte[j];
      Object[] arrayOfObject = new Object[1];
      Byte localByte = Byte.valueOf(b);
      arrayOfObject[0] = localByte;
      Formatter localFormatter2 = localFormatter1.format('x', arrayOfObject);
      j += 1;
    }
  }
 private String javaSha1FileHash(String paramString)
  {
  &nbs
标签:

杂谈

分类: JAVA

Description

Below I present you two different ways to get the current Class:

    标签:

    杂谈

    分类: android
    
      F:\ApkTool>apktool  d z4root.apk I: Baksmaling... I: Loading resource table... I: Loaded. I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: C:\Users\doudouhe\apktool\framework\1.apk I: Loaded. I: Decoding file-resources... I: Decoding values */* XMLs... I: Done. I: Copying assets and libs...  F:\ApkTool>apktool b z4root I: Checking whether sources has changed... I: Smaling... I: Checking whether resources has changed... I: Building resources... F:\ApkTool\z4root\res\values\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given name '@*android:style/Theme.Light'. Exception in thread 'main' brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --mi n-sdk-version, 4, -F, C:\Users\doudouhe\AppData\Local\Temp\APKTOOL514
    
    (2012-12-17 13:24)
    标签:

    杂谈

    分类: Linux
    命令及解释用红色字体,命令所需参数的参数值用斜体标示。


    先来看一个比较基本的用法:

    tc
    标签:

    杂谈

    分类: JAVA

    java中的String字符串属于常量类,使用的场合比较多。其中字符串的剪切使用更是频繁,split是一种很好,也是使用很频繁的字符串剪切方式,对于以'.'和'|'为分隔符的字符串,用split剪切时需要转义一下,否则无效。注意代码中的'\\.'和'\\|'

     

    标签:

    杂谈

    分类: android

    构造自己的adapter,在getView中,设置颜色,点击item,刷新listview。

    代码:

    view plaincopy to clipboardprint?
    import java.util.ArrayList;  
    import java.util.HashMap;  
    import java.util.List;  
    import java.util.Map;  
    import android.app.Activity;  
    import android.content.Context;  
    import android.graphics.Color;  
    import android.os.Bundle;  
    import android.view.LayoutInflater;  
    import android.view.View;  
    import android.view.ViewGroup;  
    import android.widget.AdapterView;  
    import android.widget.BaseAdapter;  
    import android.widget.ListView;  
    import android.widget.TextView;  
    public class MyListView4 extends Activity {  
        private List<Map<String, Object>> mData;   &

    标签:

    杂谈

    分类: android

    object.wait(long timeout)方法需要慎用(zz)- -

                                          

    这篇文章用代码讲解object.wait(long timeout)方法的使用.


    还是关于wait()这个方面的话题,Object类除了提供wait()这个方法之外,还提供了另外一方法,那就是wait(long timeout);
    javadoc上对这个方法的说明是:
    Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
    于是我想测试一下如果没有另外的线程来调用notify()或者notifyAll(), 那么wait()方法真的可以在指定的时间内返回么?
    试想一下,如果一个线程t1中对一个object.wait(1000), t1进入阻塞并且释放object的monitor, 线程t2获得了object的monitor, 如果t2握住object的monitor超过了1000毫秒,比如5000毫秒,那么t1的wait(1000)方

      

    新浪BLOG意见反馈留言板 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

    新浪公司 版权所有