亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? readaheadinputstream.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
字號:
/* Copyright (C) 2002-2005 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it is applied to this software. View the full text of the exception in file EXCEPTIONS-CONNECTOR-J in the directory of this software distribution. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */package com.mysql.jdbc.util;import java.io.IOException;import java.io.InputStream;import com.mysql.jdbc.log.Log;/** * A non-blocking buffered input stream. Reads more if it can, won't block to * fill the buffer, only blocks to satisfy a request of read(byte[]) *  * @author Mark Matthews *  * @version $Id: ReadAheadInputStream.java,v 1.1.2.1 2005/05/13 18:58:39 *          mmatthews Exp $ */public class ReadAheadInputStream extends InputStream {	private final static int DEFAULT_BUFFER_SIZE = 4096;	private InputStream underlyingStream;	private byte buf[];	protected int endOfCurrentData;	protected int currentPosition;	protected boolean doDebug = false;		protected Log log;	private void fill(int readAtLeastTheseManyBytes) throws IOException {		checkClosed();		this.currentPosition = 0; /* no mark: throw away the buffer */		this.endOfCurrentData = currentPosition;		// Read at least as many bytes as the caller wants, but don't		// block to fill the whole buffer (like java.io.BufferdInputStream		// does)		int bytesToRead = Math.min(this.buf.length - currentPosition,				readAtLeastTheseManyBytes);		int bytesAvailable = this.underlyingStream.available();		if (bytesAvailable > bytesToRead) {			// Great, there's more available, let's grab those			// bytes too! (read-ahead)			bytesToRead = Math.min(this.buf.length - currentPosition,					bytesAvailable);		}		if (this.doDebug) {			StringBuffer debugBuf = new StringBuffer();			debugBuf.append("  ReadAheadInputStream.fill(");			debugBuf.append(readAtLeastTheseManyBytes);			debugBuf.append("), buffer_size=");			debugBuf.append(this.buf.length);			debugBuf.append(", current_position=");			debugBuf.append(currentPosition);			debugBuf.append(", need to read ");			debugBuf.append(Math.min(this.buf.length - currentPosition,					readAtLeastTheseManyBytes));			debugBuf.append(" bytes to fill request,");			if (bytesAvailable > 0) {				debugBuf.append(" underlying InputStream reports ");				debugBuf.append(bytesAvailable);				debugBuf.append(" total bytes available,");			}			debugBuf.append(" attempting to read ");			debugBuf.append(bytesToRead);			debugBuf.append(" bytes.");			if (this.log != null) {				this.log.logTrace(debugBuf.toString());			} else {				System.err.println(debugBuf.toString());			}		}		int n = this.underlyingStream.read(this.buf, currentPosition,				bytesToRead);		if (n > 0) {			endOfCurrentData = n + currentPosition;		}	}	private int readFromUnderlyingStreamIfNecessary(byte[] b, int off, int len)			throws IOException {		checkClosed();		int avail = endOfCurrentData - currentPosition;		if (this.doDebug) {			StringBuffer debugBuf = new StringBuffer();			debugBuf.append("ReadAheadInputStream.readIfNecessary(");			debugBuf.append(b);			debugBuf.append(",");			debugBuf.append(off);			debugBuf.append(",");			debugBuf.append(len);			debugBuf.append(")");			if (avail <= 0) {				debugBuf						.append(" not all data available in buffer, must read from stream");				if (len >= this.buf.length) {					debugBuf							.append(", amount requested > buffer, returning direct read() from stream");				}			}			if (this.log != null) {				this.log.logTrace(debugBuf.toString());			} else {				System.err.println(debugBuf.toString());			}		}		if (avail <= 0) {			if (len >= this.buf.length) {				return this.underlyingStream.read(b, off, len);			}			fill(len);			avail = endOfCurrentData - currentPosition;			if (avail <= 0)				return -1;		}		int bytesActuallyRead = (avail < len) ? avail : len;		System.arraycopy(this.buf, currentPosition, b, off, bytesActuallyRead);		this.currentPosition += bytesActuallyRead;		return bytesActuallyRead;	}	public synchronized int read(byte b[], int off, int len) throws IOException {		checkClosed(); // Check for closed stream		if ((off | len | (off + len) | (b.length - (off + len))) < 0) {			throw new IndexOutOfBoundsException();		} else if (len == 0) {			return 0;		}		int totalBytesRead = 0;		while (true) {			int bytesReadThisRound = readFromUnderlyingStreamIfNecessary(b, off					+ totalBytesRead, len - totalBytesRead);			// end-of-stream?			if (bytesReadThisRound <= 0) {				if (totalBytesRead == 0) {					totalBytesRead = bytesReadThisRound;				}				break;			}			totalBytesRead += bytesReadThisRound;			// Read _at_least_ enough bytes			if (totalBytesRead >= len) {				break;			}			// Nothing to read?			if (this.underlyingStream.available() <= 0) {				break;			}		}		return totalBytesRead;	}	public int read() throws IOException {		checkClosed();		if (currentPosition >= endOfCurrentData) {			fill(1);			if (currentPosition >= endOfCurrentData)				return -1;		}		return this.buf[currentPosition++] & 0xff;	}	public int available() throws IOException {		checkClosed();		return this.underlyingStream.available()				+ (this.endOfCurrentData - this.currentPosition);	}	private void checkClosed() throws IOException {		if (this.buf == null) {			throw new IOException("Stream closed");		}	}	/**	 * 	 */	public ReadAheadInputStream(InputStream toBuffer, boolean debug, Log logTo) {		this(toBuffer, DEFAULT_BUFFER_SIZE, debug, logTo);	}	public ReadAheadInputStream(InputStream toBuffer, int bufferSize,			boolean debug,			Log logTo) {		this.underlyingStream = toBuffer;		this.buf = new byte[bufferSize];		this.doDebug = debug;		this.log = logTo;	}	/*	 * (non-Javadoc)	 * 	 * @see java.io.Closeable#close()	 */	public void close() throws IOException {		if (this.underlyingStream != null) {			try {				this.underlyingStream.close();			} finally {				this.underlyingStream = null;				this.buf = null;				this.log = null;			}		}	}	/*	 * (non-Javadoc)	 * 	 * @see java.io.InputStream#markSupported()	 */	public boolean markSupported() {		return false;	}	/*	 * (non-Javadoc)	 * 	 * @see java.io.InputStream#skip(long)	 */	public long skip(long n) throws IOException {		checkClosed();		if (n <= 0) {			return 0;		}		long bytesAvailInBuffer = this.endOfCurrentData - this.currentPosition;		if (bytesAvailInBuffer <= 0) {			fill((int) n);			bytesAvailInBuffer = this.endOfCurrentData - this.currentPosition;			if (bytesAvailInBuffer <= 0)				return 0;		}		long bytesSkipped = (bytesAvailInBuffer < n) ? bytesAvailInBuffer : n;		this.currentPosition += bytesSkipped;		return bytesSkipped;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久线在线观看| 欧美日韩国产首页| 国产调教视频一区| 人人狠狠综合久久亚洲| 精品视频色一区| 亚洲国产精品一区二区www在线| 欧美在线不卡一区| 亚洲一区二区三区视频在线| 在线精品亚洲一区二区不卡| 亚洲免费av网站| 成人激情av网| 亚洲国产aⅴ天堂久久| 欧美中文字幕不卡| 亚洲第一主播视频| 欧美日韩中文字幕一区| 日韩中文字幕区一区有砖一区| 欧美嫩在线观看| 综合av第一页| 欧美天堂一区二区三区| 日本中文字幕一区二区有限公司| 欧美三级电影在线观看| 日本va欧美va精品| 久久久久综合网| 成人av在线观| 亚洲综合一二三区| 日韩欧美一区在线观看| 99久久免费国产| 亚洲一区二区三区三| 日韩一区二区三区在线视频| 久久aⅴ国产欧美74aaa| 一区二区三区欧美视频| 欧美情侣在线播放| 国产在线播放一区| 亚洲与欧洲av电影| 精品裸体舞一区二区三区| 国产成a人亚洲精品| 亚洲一区二区三区四区五区中文| 国产精品日日摸夜夜摸av| 色综合咪咪久久| 日本伊人精品一区二区三区观看方式| 日韩一本二本av| 久久免费视频一区| av激情成人网| 免费成人在线影院| 国产精品久久网站| 8x8x8国产精品| 国产精品香蕉一区二区三区| 亚洲第一电影网| 国产精品丝袜91| 91精品蜜臀在线一区尤物| 成人做爰69片免费看网站| 免费观看一级特黄欧美大片| 成人免费一区二区三区视频| 日韩一区二区免费高清| 色综合久久66| 岛国精品一区二区| 久久99国产精品尤物| 亚洲综合在线视频| 国产精品人成在线观看免费| 91精品国产高清一区二区三区蜜臀| 成人午夜激情视频| 极品少妇xxxx精品少妇| 亚洲一区在线电影| 一区免费观看视频| 久久久影视传媒| 精品国产精品网麻豆系列 | 国产精品久线观看视频| 欧美日韩精品专区| 懂色av一区二区三区蜜臀| 免费一级欧美片在线观看| 亚洲美女电影在线| 国产精品久久久久一区| 久久综合精品国产一区二区三区| 欧美精品三级日韩久久| 在线观看一区日韩| 91啪九色porn原创视频在线观看| 国产精品主播直播| 激情av综合网| 免费成人结看片| 午夜精品一区在线观看| 有码一区二区三区| 亚洲人妖av一区二区| 亚洲老司机在线| 自拍偷拍欧美激情| 中文字幕在线不卡一区| 亚洲精品一区二区在线观看| 日韩欧美国产综合一区| 欧美一区二区三区免费视频| 欧美日韩中文精品| 国产99久久久国产精品| 亚洲激情自拍视频| 婷婷久久综合九色国产成人| 日本不卡123| 久久99这里只有精品| 成人午夜视频福利| 91国产免费观看| 欧美一区三区四区| 久久久久久99精品| 日韩毛片精品高清免费| 亚洲va韩国va欧美va精品| 九九精品视频在线看| 国产精品系列在线播放| 色域天天综合网| 欧美一区二区在线不卡| 久久精品亚洲乱码伦伦中文| 国产精品福利影院| 丝袜美腿高跟呻吟高潮一区| 国产美女在线精品| 一本色道a无线码一区v| 久久精品视频免费| 亚洲精品乱码久久久久久久久| 天堂蜜桃一区二区三区| 国产精品一区二区免费不卡| 在线观看av一区二区| 精品日韩欧美一区二区| 一区二区中文视频| 蜜桃久久精品一区二区| 91一区二区在线| 欧美大白屁股肥臀xxxxxx| 中文字幕中文在线不卡住| 日韩黄色小视频| 成人av在线资源网| 日韩欧美高清在线| 亚洲精品少妇30p| 激情久久久久久久久久久久久久久久| av一本久道久久综合久久鬼色| 91精品婷婷国产综合久久 | 久久综合久色欧美综合狠狠| 亚洲三级电影网站| 精品中文字幕一区二区| 色吊一区二区三区| 国产女人18水真多18精品一级做| 五月婷婷久久综合| 色综合久久久久综合体| 亚洲精品一区二区三区精华液| 亚洲男同性视频| 国产精品77777| 91精品久久久久久蜜臀| 一个色在线综合| 成人黄色av网站在线| 精品国产自在久精品国产| 亚洲国产精品一区二区尤物区| 粉嫩高潮美女一区二区三区| 日韩一二在线观看| 日本在线不卡一区| 欧美伦理影视网| 亚洲一区二区视频| 色吊一区二区三区| 亚洲精品国产精品乱码不99| 成人午夜激情在线| 欧美激情综合五月色丁香小说| 久久99九九99精品| 日韩精品一区二区三区在线观看 | 精品国产一二三| 日本不卡免费在线视频| 在线91免费看| 亚洲一区二区三区小说| 欧美午夜精品一区二区蜜桃| 亚洲精品国产品国语在线app| av激情综合网| 亚洲日本在线天堂| 一本色道**综合亚洲精品蜜桃冫| 136国产福利精品导航| 92国产精品观看| 中文久久乱码一区二区| 成人v精品蜜桃久久一区| 欧美国产亚洲另类动漫| 99久久婷婷国产精品综合| 亚洲四区在线观看| 在线观看日韩毛片| 午夜精品影院在线观看| 欧美一级片在线看| 六月婷婷色综合| 国产欧美精品在线观看| 不卡视频在线观看| 亚洲另类在线制服丝袜| 欧美日韩亚洲不卡| 美女免费视频一区| 久久久99久久精品欧美| 不卡的av网站| 亚洲精品ww久久久久久p站| 精品视频在线免费看| 美女在线观看视频一区二区| 久久久久久久久蜜桃| av在线这里只有精品| 亚洲国产欧美在线| 欧美xxx久久| 99久久综合国产精品| 夜夜嗨av一区二区三区中文字幕| 欧美午夜在线一二页| 久久国产精品99精品国产| 国产亚洲短视频| 色噜噜狠狠成人网p站| 免费成人结看片| 国产精品美女久久久久久久网站| av激情综合网| 热久久一区二区| 中文字幕一区二区在线观看| 欧美日韩成人综合| 国产成人免费av在线|