proxyoutputstream.java
来自「基于Jabber协议的即时消息服务器」· Java 代码 · 共 31 行
JAVA
31 行
/**
* $RCSfile $
* $Revision $
* $Date $
*
* Copyright (C) 1999-2005 Jive Software. All rights reserved.
* This software is the proprietary information of Jive Software. Use is subject to license terms.
*/
package org.jivesoftware.wildfire.filetransfer.proxy;
import java.io.OutputStream;
import java.io.IOException;
import java.io.DataOutputStream;
import java.util.concurrent.atomic.AtomicLong;
/**
* An output stream which tracks the amount of bytes transfered by proxy sockets.
*/
public class ProxyOutputStream extends DataOutputStream {
static AtomicLong amountTransfered = new AtomicLong(0);
public ProxyOutputStream(OutputStream out) {
super(out);
}
public synchronized void write(byte b[], int off, int len) throws IOException {
super.write(b, off, len);
amountTransfered.addAndGet(len);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?