⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blobimpl.java

📁 羽量级数据持久层开发框架
💻 JAVA
字号:
package org.speedframework.entity;

//~--- JDK imports ------------------------------------------------------------

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

import java.sql.Blob;
import java.sql.SQLException;

/**
 * Blob ???????
 *
 * @author lizf
 */
public class BlobImpl implements Blob
 {

    /** 属性描述信息 */
    private boolean needsReset = false;

    /** 属性描述信息 */
    private int length;

    /** 属性描述信息 */
    private InputStream stream;

    /**
     * Constructs ...
     *
     *
     * @param bytes
     */
    public BlobImpl(byte[] bytes) {
        this.stream = new ByteArrayInputStream(bytes);
        this.length = bytes.length;
    }

    /**
     * Constructs ...
     *
     *
     * @param stream
     * @param length
     */
    public BlobImpl(InputStream stream, int length) {
        this.stream = stream;
        this.length = length;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @return
     *
     * @throws SQLException
     */
    public long length() throws SQLException {
        return length;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param len
     *
     * @throws SQLException
     */
    public void truncate(long len) throws SQLException {

        // TODO ????????????
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param pos
     * @param length
     *
     * @return
     *
     * @throws SQLException
     */
    public byte[] getBytes(long pos, int length) throws SQLException {

        // TODO ????????????
        return null;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param pos
     * @param bytes
     *
     * @return
     *
     * @throws SQLException
     */
    public int setBytes(long pos, byte[] bytes) throws SQLException {

        // TODO ????????????
        return 0;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param pos
     * @param bytes
     * @param offset
     * @param len
     *
     * @return
     *
     * @throws SQLException
     */
    public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException {

        // TODO ????????????
        return 0;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param pattern
     * @param start
     *
     * @return
     *
     * @throws SQLException
     */
    public long position(byte[] pattern, long start) throws SQLException {

        // TODO ????????????
        return 0;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @return
     *
     * @throws SQLException
     */
    public InputStream getBinaryStream() throws SQLException {

        // TODO ????????????
        try {
            if (needsReset) {
                stream.reset();
            }
        } catch (IOException ioe) {
            throw new SQLException("could not reset reader");
        }

        needsReset = true;

        return stream;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param pos
     *
     * @return
     *
     * @throws SQLException
     */
    public OutputStream setBinaryStream(long pos) throws SQLException {

        // TODO ????????????
        return null;
    }

    /**
     * 方法描述信息,
     * 描述方法是做什么的,
     * 如何调用,最好给出调用代码示例。
     *
     * @param pattern
     * @param start
     *
     * @return
     *
     * @throws SQLException
     */
    public long position(Blob pattern, long start) throws SQLException {

        // TODO ????????????
        return 0;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -