org.hibernate.type.descriptor.java.DataHelper#extractBytes ( )源码实例Demo

下面列出了org.hibernate.type.descriptor.java.DataHelper#extractBytes ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: BlobProxy.java
@Override
public byte[] getBytes() {
	if ( bytes == null ) {
		bytes = DataHelper.extractBytes( stream );
	}
	return bytes;
}
 
源代码2 项目: cosmo   文件: BufferedContentTypeDescriptor.java
@Override
@SuppressWarnings("unchecked")
public <X> X unwrap(BufferedContent value, Class<X> type, WrapperOptions options) {
    if (value == null) {
        return null;
    }
    if (BufferedContent.class.isAssignableFrom(type)) {
        return (X) value;
    }
    if (BinaryStream.class.isAssignableFrom(type)) {
        return (X) new BinaryStreamImpl(DataHelper.extractBytes(value.getInputStream()));
    }
    throw unknownUnwrap(type);
}
 
源代码3 项目: cosmo   文件: BufferedContentTypeDescriptor.java
@Override
public String toString(BufferedContent value) {
    final byte[] bytes;
    bytes = DataHelper.extractBytes(value.getInputStream());
    return PrimitiveByteArrayTypeDescriptor.INSTANCE.toString(bytes);
}