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

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

?? blob.java

?? jsp數據庫系統
?? JAVA
字號:
/*
   Copyright (C) 2002 MySQL AB

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
      (at your option) any later version.

      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;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;

import java.sql.SQLException;


/**
 * The representation (mapping) in the JavaTM programming language  of an SQL
 * BLOB value. An SQL BLOB is a built-in type that stores  a Binary Large
 * Object as a column value in a row of a database  table. The driver
 * implements Blob using an SQL locator(BLOB),  which means that a Blob object
 * contains a logical pointer to the  SQL BLOB data rather than the data
 * itself. A Blob object is valid  for the duration of the transaction in
 * which is was created.   Methods in the interfaces ResultSet,
 * CallableStatement, and  PreparedStatement, such as getBlob and setBlob
 * allow a programmer  to access an SQL BLOB value. The Blob interface
 * provides methods  for getting the length of an SQL BLOB (Binary Large
 * Object) value,  for materializing a BLOB value on the client, and for
 * determining  the position of a pattern of bytes within a BLOB value.   This
 * class is new in the JDBC 2.0 API.
 *
 * @author Mark Matthews
 *
 * @version $Id: Blob.java,v 1.9.2.6 2003/12/24 05:16:26 mmatthew Exp $
 */
public class Blob implements java.sql.Blob, OutputStreamWatcher {
    //~ Instance fields --------------------------------------------------------

    /** The ResultSet that created this BLOB */
    private ResultSet creatorResultSet;

    //
    // This is a real brain-dead implementation of BLOB. Once I add
    // streamability to the I/O for MySQL this will be more efficiently
    // implemented (except for the position() method, ugh).
    //

    /** The binary data that makes up this BLOB */
    private byte[] binaryData = null;

    /** The column that this BLOB came from */
    private int columnIndex;

    //~ Constructors -----------------------------------------------------------

    /**
     * Creates a BLOB encapsulating the given binary data
     */
    Blob(byte[] data) {
        setBinaryData(data);
        this.creatorResultSet = null;
        this.columnIndex = 0;
    }

    /**
     * Creates an updatable BLOB that can update in-place
     * (not implemented yet).
     */
    Blob(byte[] data, ResultSet creatorResultSet, int columnIndex) {
        setBinaryData(data);
        this.creatorResultSet = creatorResultSet;
        this.columnIndex = columnIndex;
    }

    //~ Methods ----------------------------------------------------------------

    /**
     * @see Blob#setBinaryStream(long)
     */
    public OutputStream setBinaryStream(long indexToWriteAt)
        throws SQLException {
        if (indexToWriteAt < 1) {
            throw new SQLException("indexToWriteAt must be >= 1", SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
        }

        WatchableOutputStream bytesOut = new WatchableOutputStream();
        bytesOut.setWatcher(this);

        if (indexToWriteAt > 0) {
            bytesOut.write(this.binaryData, 0, (int) (indexToWriteAt - 1));
        }

        return bytesOut;
    }

    /**
     * Retrieves the BLOB designated by this Blob instance as a stream.
     *
     * @return this BLOB represented as a binary stream of bytes.
     *
     * @throws SQLException if a database error occurs
     */
    public java.io.InputStream getBinaryStream() throws SQLException {
        return new ByteArrayInputStream(getBinaryData());
    }

    /**
     * @see Blob#setBytes(long, byte[], int, int)
     */
    public int setBytes(long writeAt, byte[] bytes, int offset, int length)
        throws SQLException {
        OutputStream bytesOut = setBinaryStream(writeAt);

        try {
            bytesOut.write(bytes, offset, length);
        } catch (IOException ioEx) {
            throw new SQLException("IO Error while writing bytes to blob",
                SQLError.SQL_STATE_GENERAL_ERROR);
        } finally {
            try {
                bytesOut.close();
            } catch (IOException doNothing) {
                ; // do nothing
            }
        }

        return length;
    }

    /**
     * @see Blob#setBytes(long, byte[])
     */
    public int setBytes(long writeAt, byte[] bytes) throws SQLException {
        return setBytes(writeAt, bytes, 0, bytes.length);
    }

    /**
     * Returns as an array of bytes, part or all of the BLOB value that this
     * Blob object designates.
     *
     * @param pos where to start the part of the BLOB
     * @param length the length of the part of the BLOB you want returned.
     *
     * @return the bytes stored in the blob starting at position
     *         <code>pos</code> and having a length of <code>length</code>.
     *
     * @throws SQLException if a database error occurs
     */
    public byte[] getBytes(long pos, int length) throws SQLException {
        if (pos < 1) {
            throw new SQLException("Position 'pos' can not be < 1", SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
        }

        byte[] newData = new byte[length];
        System.arraycopy(getBinaryData(), (int) (pos - 1), newData, 0, length);

        return newData;
    }

    /**
     * Returns the number of bytes in the BLOB value designated by this Blob
     * object.
     *
     * @return the length of this blob
     *
     * @throws SQLException if a database error occurs
     */
    public long length() throws SQLException {
        return getBinaryData().length;
    }

    /**
     * Finds the position of the given pattern in this BLOB.
     *
     * @param pattern the pattern to find
     * @param start where to start finding the pattern
     *
     * @return the position where the pattern is found in the BLOB, -1 if not
     *         found
     *
     * @throws SQLException if a database error occurs
     */
    public long position(java.sql.Blob pattern, long start)
        throws SQLException {
        return position(pattern.getBytes(0, (int) pattern.length()), start);
    }

    /**
     * @see java.sql.Blob#position(byte[], long)
     */
    public long position(byte[] pattern, long start) throws SQLException {
        throw new SQLException("Not implemented");
    }

    /**
     * @see com.mysql.jdbc.OutputStreamWatcher#streamClosed(byte[])
     */
    public void streamClosed(byte[] byteData) {
        this.binaryData = byteData;
    }

    /**
     * @see Blob#truncate(long)
     */
    public void truncate(long arg0) throws SQLException {
        throw new NotImplemented();
    }

    private void setBinaryData(byte[] binaryData) {
        this.binaryData = binaryData;
    }

    private byte[] getBinaryData() {
        return binaryData;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品免费**视频| 国产一区二区精品久久| 亚洲h在线观看| 亚洲尤物视频在线| 亚洲三级电影网站| 日韩在线观看一区二区| 亚洲嫩草精品久久| 日本美女一区二区三区视频| 国产九色精品成人porny| 91香蕉视频mp4| 久久久久久97三级| 中文字幕一区免费在线观看| 亚洲一级片在线观看| 精品在线播放免费| 欧美在线色视频| 亚洲国产电影在线观看| 奇米影视在线99精品| 色综合色狠狠天天综合色| 欧美电视剧免费全集观看| 国产精品久久网站| 精品一区二区三区在线观看| 国产91高潮流白浆在线麻豆| 国产成人99久久亚洲综合精品| 成人美女视频在线观看| 欧美日韩黄色一区二区| 久久久综合激的五月天| 一区二区三区中文字幕在线观看| 国产精品亚洲成人| 51精品国自产在线| 国产精品天美传媒沈樵| 蜜桃av噜噜一区| 91在线精品一区二区| 久久亚洲免费视频| 日韩精彩视频在线观看| 色哟哟一区二区在线观看| 中文字幕免费不卡| 国产.欧美.日韩| 久久久久久电影| 强制捆绑调教一区二区| 欧美精三区欧美精三区| 亚洲精品一卡二卡| 91免费看片在线观看| 亚洲图片你懂的| a级精品国产片在线观看| 久久综合999| 国产伦精品一区二区三区免费| 日韩午夜激情电影| 久久精品国产99国产精品| 日韩免费观看高清完整版| 国产一区二区在线影院| 精品国产a毛片| 国产精品一区免费视频| 日韩欧美一区中文| 国产在线视视频有精品| 中文字幕国产精品一区二区| 国产高清视频一区| 国产精品国产三级国产aⅴ中文| 国产精品一级在线| 亚洲欧洲综合另类| 欧美日韩一区视频| 国产一区二区三区av电影| 亚洲国产精品国自产拍av| av网站免费线看精品| 亚洲精品国产精华液| 欧美理论片在线| 国产精品一卡二卡| 亚洲精品欧美激情| 欧美视频一区二区在线观看| 尤物视频一区二区| 欧美日韩视频在线一区二区| 日韩制服丝袜av| 久久久久久免费网| 日韩视频在线观看一区二区| 国产最新精品精品你懂的| 国产精品高潮呻吟| 日韩欧美视频一区| 成人a免费在线看| 亚洲资源在线观看| 久久久久久久av麻豆果冻| 日本道色综合久久| 亚洲国产视频在线| 国产午夜亚洲精品不卡| 一本大道av一区二区在线播放| 琪琪一区二区三区| 亚洲人成网站精品片在线观看 | 91麻豆精品国产91| 国产一区二区三区免费在线观看| 天天射综合影视| 亚洲一区二区欧美日韩| 色综合久久88色综合天天免费| 日韩不卡一区二区三区| 亚洲免费毛片网站| 久久久精品2019中文字幕之3| 欧美日韩亚洲高清一区二区| 成人黄色在线视频| 国产传媒日韩欧美成人| 国产一本一道久久香蕉| 天天爽夜夜爽夜夜爽精品视频| 欧美激情在线一区二区三区| 精品国产污网站| 91精品久久久久久蜜臀| 91在线一区二区三区| 精品亚洲国产成人av制服丝袜| 亚洲国产精品久久久久秋霞影院 | 欧美巨大另类极品videosbest| 91成人国产精品| 色94色欧美sute亚洲线路二| 捆绑调教一区二区三区| 久久不见久久见免费视频7| 亚洲第一主播视频| 午夜精品久久久久久不卡8050| 亚洲免费观看高清完整版在线 | 亚洲男人都懂的| 中文在线免费一区三区高中清不卡| 日本韩国精品在线| 粉嫩av一区二区三区| 国产精品中文有码| 91麻豆123| 在线观看免费成人| 欧美色区777第一页| 91麻豆精品国产91久久久久| 精品国产成人在线影院| 久久精品亚洲精品国产欧美| 日韩一区二区在线观看视频| 日韩三区在线观看| 亚洲国产精品精华液ab| 一区二区视频免费在线观看| 日本在线不卡一区| 国产伦精品一区二区三区在线观看| 国产高清精品在线| 欧美在线免费观看亚洲| 欧美三级资源在线| 911精品国产一区二区在线| 精品国产乱码久久久久久图片| 欧美精品亚洲二区| 精品99一区二区| 懂色av一区二区三区蜜臀| 欧美日韩综合在线免费观看| 精品99一区二区三区| 三级在线观看一区二区| 免费在线观看不卡| 欧美少妇一区二区| 欧美一区二区三区免费| 2017欧美狠狠色| 午夜久久电影网| 91蜜桃传媒精品久久久一区二区| 日韩精品在线一区| 一区2区3区在线看| 国产.欧美.日韩| 国产午夜精品一区二区| 国精产品一区一区三区mba桃花| 欧美日韩在线观看一区二区| 欧美性大战久久久| 综合自拍亚洲综合图不卡区| 国产一区二区免费视频| 精品毛片乱码1区2区3区| 亚洲国产日韩a在线播放性色| 成av人片一区二区| 国产精品国产精品国产专区不片| 久久国产生活片100| 国产午夜精品一区二区三区嫩草| 国产酒店精品激情| 国产精品灌醉下药二区| 波多野结衣在线aⅴ中文字幕不卡| 国产三级精品三级在线专区| 国产一区欧美一区| 精品国产伦一区二区三区免费| 久久国产精品99久久久久久老狼| 欧美一区二区精品久久911| 日韩专区在线视频| 精品成人一区二区| 不卡大黄网站免费看| 亚洲欧美经典视频| 欧美日韩在线三区| 久久不见久久见中文字幕免费| 久久久久久久久岛国免费| 成人app软件下载大全免费| 亚洲精品视频观看| 精品久久久久久久久久久院品网 | 国产日产亚洲精品系列| 97se亚洲国产综合在线| 日韩二区三区四区| 久久婷婷一区二区三区| 色婷婷精品久久二区二区蜜臀av | 国产麻豆视频一区二区| 国产精品少妇自拍| 在线观看视频一区| 精品一区二区三区在线视频| 国产无人区一区二区三区| av动漫一区二区| 奇米在线7777在线精品| 久久蜜臀精品av| 91啪亚洲精品| 黑人巨大精品欧美一区| 日韩激情av在线| 亚洲国产综合视频在线观看| 国产精品毛片大码女人| 欧美一区二区视频网站| 在线观看欧美黄色| 国产一区二区三区免费播放|