speed.java

来自「羽量级数据持久层开发框架」· Java 代码 · 共 69 行

JAVA
69
字号
package org.speedframework;


import org.speedframework.entity.BlobImpl;
import org.speedframework.entity.ClobImpl;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;

import java.sql.Blob;
import java.sql.Clob;


/**
 * Class Speed
 * 对象初始化类
 * @author <a href="mailto:santafeng@gmail.com"> lizf </a>
 * @version $Revision:1.0.0, $Date: 2007-10-9 9:21:24 $
 */
public final class Speed
 {

    /**
     * Method initializeBlob
     * 
     * @param bytes 
     * @return Blob对象
     */
    public static Blob initializeBlob(byte[] bytes) {
        return new BlobImpl(bytes);
    }

    /**
     * @param stream
     * @return
     * @throws IOException
     */
    public static Blob initializeBlob(InputStream stream) throws IOException {
        return new BlobImpl(stream, stream.available());
    }

    /**
     * @param stream
     * @param length
     * @return
     */
    public static Blob initializeBlob(InputStream stream, int length) {
        return new BlobImpl(stream, length);
    }

    /**
     * @param str
     * @return
     */
    public static Clob initializeClob(String str) {
        return new ClobImpl(str);
    }

    /**
     * @param reader
     * @param length
     * @return
     */
    public static Clob initializeClob(Reader reader, int length) {
        return new ClobImpl(reader, length);
    }
}

⌨️ 快捷键说明

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