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

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

?? readaheadinputstream.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? 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一区二区三区免费野_久草精品视频
亚洲日本在线a| 不卡av在线免费观看| 91国产免费观看| 国产精品国产成人国产三级 | 色婷婷国产精品久久包臀 | 欧美日韩的一区二区| 亚洲一区在线观看免费 | 亚洲精品美腿丝袜| av在线免费不卡| 亚洲色图另类专区| 欧美三级日韩在线| 蜜桃一区二区三区四区| 精品久久久久一区| 国产宾馆实践打屁股91| 中文字幕在线不卡国产视频| av网站免费线看精品| 亚洲少妇中出一区| 色婷婷av一区| 免费精品视频最新在线| 亚洲精品在线观看网站| 国产成人精品综合在线观看| 久久精品一区二区三区四区| 北岛玲一区二区三区四区| 亚洲女同一区二区| 欧美久久一区二区| 国产又粗又猛又爽又黄91精品| 久久久亚洲精华液精华液精华液 | 亚洲国产另类av| 久久免费看少妇高潮| 欧美日韩国产区一| 国产精品亚洲成人| 日韩电影一区二区三区四区| 国产免费观看久久| 9191成人精品久久| 91免费视频大全| 国产专区欧美精品| 蜜桃av噜噜一区二区三区小说| 国产精品理伦片| 久久久亚洲精品一区二区三区 | 免费在线视频一区| 国产精品久久久久一区| 欧美一区二区久久| 欧美三区在线视频| 91精品办公室少妇高潮对白| 精品在线你懂的| 久久成人av少妇免费| 亚洲成人第一页| 亚洲一级在线观看| 日韩美女视频一区二区 | 欧美经典三级视频一区二区三区| 欧美日韩久久久| 91 com成人网| 欧美年轻男男videosbes| 欧美性色欧美a在线播放| 色综合久久九月婷婷色综合| 色噜噜狠狠色综合中国| 91精品福利视频| 欧美日韩一区二区三区不卡| 欧美在线一区二区| 欧美日韩国产三级| 日韩女优毛片在线| 久久精品亚洲一区二区三区浴池 | 国产.精品.日韩.另类.中文.在线.播放| 日本三级亚洲精品| 另类调教123区| 成人一区二区在线观看| 成人激情动漫在线观看| 色域天天综合网| 3d动漫精品啪啪| 日本一区二区高清| 亚洲一区二区三区影院| 国产在线不卡视频| av电影在线观看完整版一区二区| 色综合久久六月婷婷中文字幕| 在线不卡免费欧美| 国产精品毛片无遮挡高清| 亚洲综合色噜噜狠狠| 国产精品99久久久久久似苏梦涵| 99热这里都是精品| 日韩三级视频在线观看| 国产精品白丝在线| 九九视频精品免费| 精品视频在线免费看| 亚洲国产精品传媒在线观看| 亚洲电影欧美电影有声小说| 成人精品免费视频| 日韩精品资源二区在线| 午夜不卡av在线| 91香蕉视频mp4| 日本一区二区三区视频视频| 日本va欧美va精品发布| 色婷婷久久综合| ...av二区三区久久精品| 精品一区二区成人精品| 日韩一区二区三区在线观看| 亚洲一区二区三区国产| 欧美午夜精品理论片a级按摩| 国产精品乱人伦中文| 成人激情开心网| 综合激情网...| 91视频精品在这里| 亚洲女性喷水在线观看一区| 在线观看视频一区| 亚洲一二三区视频在线观看| 97久久人人超碰| 亚洲综合在线五月| 欧美在线观看一区二区| 亚洲国产成人av好男人在线观看| 91丨porny丨最新| 麻豆国产精品777777在线| 91成人免费电影| 日本亚洲电影天堂| 久久久美女毛片| 色综合天天综合网天天狠天天| 伊人婷婷欧美激情| 日韩亚洲电影在线| 国产成人在线看| 亚洲成人免费在线| 欧美一区二区精品久久911| 国产乱码精品一区二区三| 亚洲国产成人一区二区三区| 在线亚洲免费视频| 激情图片小说一区| 一区二区在线观看免费| 欧美乱妇23p| www.亚洲国产| 精品一区二区三区影院在线午夜| 国产亚洲成aⅴ人片在线观看 | 国产精品久久久久影视| 欧美色图一区二区三区| 国产宾馆实践打屁股91| 性做久久久久久| 国产精品夫妻自拍| 久久亚洲影视婷婷| 欧美女孩性生活视频| 在线视频国内自拍亚洲视频| 成人av电影在线| 国产精品影视网| 黄色成人免费在线| 图片区日韩欧美亚洲| 一区二区三区日韩在线观看| 中文字幕欧美激情一区| 欧美激情一二三区| 久久久美女毛片| 国产亚洲1区2区3区| 亚洲精品一区二区三区精华液| 欧美精品丝袜中出| 日韩一区二区在线看片| 91精品国产美女浴室洗澡无遮挡| 色av综合在线| 欧美老肥妇做.爰bbww| 欧美日韩在线精品一区二区三区激情| 99re这里只有精品6| 91亚洲国产成人精品一区二区三 | 国产一区二区伦理| 国产精品69毛片高清亚洲| 国产福利一区二区三区视频| 国产成a人无v码亚洲福利| 欧美精品日韩一本| 成人短视频下载| 亚洲一区二区三区三| 亚洲精品欧美激情| 国产香蕉久久精品综合网| 欧美精品日韩一本| 欧美三级视频在线| 欧美色网一区二区| 精品视频123区在线观看| 国产99久久久国产精品免费看| 黄色精品一二区| 国产精品一区免费在线观看| 色婷婷av一区二区三区大白胸| 欧美激情艳妇裸体舞| 国产成人精品一区二区三区四区| 久久先锋影音av鲁色资源网| 久久99精品国产麻豆婷婷| 国产精品久久精品日日| 男女男精品网站| 美国毛片一区二区三区| 久久69国产一区二区蜜臀| 久久国产视频网| 丁香一区二区三区| 欧美日产国产精品| 日本一区二区三区视频视频| 欧美国产激情一区二区三区蜜月 | 亚洲一区在线观看网站| 奇米精品一区二区三区在线观看| 日韩精品三区四区| 国产在线国偷精品产拍免费yy| 国产永久精品大片wwwapp| 国产精品一区三区| 国产成+人+日韩+欧美+亚洲| 色婷婷av一区| 国产蜜臀97一区二区三区| 亚洲欧洲综合另类| a4yy欧美一区二区三区| 久久久久久久久久久久久夜| 国产精品美日韩| 亚洲色图制服诱惑| 美女视频黄 久久| 99国产精品国产精品毛片|