日期:2014-05-20 浏览次数:20912 次
private long time;
/**
* 存放数据
* @param bytes
* @return
*/
public synchronized boolean putData(byte[] bytes){
try {
while(this.isFull()){
time=System.currentTimeMillis(); //用以验证缓存满的时间
this.wait();
}
time=0L;
this.notify();
} catch (InterruptedException e) {
e.printStackTrace();
return false;
}
this.buff.put(bytes);
return true;
}