FileDocCategorySizeDatePackage
BlobImpl.javaAPI DocHibernate 3.2.52306Sat Dec 18 11:48:20 GMT 2004org.hibernate.lob

BlobImpl

public class BlobImpl extends Object implements Blob
A dummy implementation of java.sql.Blob that may be used to insert new data into a BLOB.
author
Gavin King

Fields Summary
private InputStream
stream
private int
length
private boolean
needsReset
Constructors Summary
public BlobImpl(byte[] bytes)


	   
		this.stream = new ByteArrayInputStream(bytes);
		this.length = bytes.length;
	
public BlobImpl(InputStream stream, int length)

		this.stream = stream;
		this.length = length;
	
Methods Summary
private static voidexcep()

		throw new UnsupportedOperationException("Blob may not be manipulated from creating session");
	
public java.io.InputStreamgetBinaryStream()

see
java.sql.Blob#getBinaryStream()

		try {
			if (needsReset) stream.reset();
		}
		catch (IOException ioe) {
			throw new SQLException("could not reset reader");
		}
		needsReset = true;
		return stream;
	
public byte[]getBytes(long pos, int len)

see
java.sql.Blob#getBytes(long, int)

		excep(); return null;
	
public longlength()

see
java.sql.Blob#length()

		return length;
	
public longposition(java.sql.Blob blob, long pos)

see
java.sql.Blob#position(Blob, long)

		excep(); return 0;
	
public longposition(byte[] bytes, long pos)

see
java.sql.Blob#position(byte[], long)

		excep(); return 0;
	
public java.io.OutputStreamsetBinaryStream(long pos)

see
java.sql.Blob#setBinaryStream(long)

		excep(); return null;
	
public intsetBytes(long pos, byte[] bytes)

see
java.sql.Blob#setBytes(long, byte[])

		excep(); return 0;
	
public intsetBytes(long pos, byte[] bytes, int i, int j)

see
java.sql.Blob#setBytes(long, byte[], int, int)

		excep(); return 0;
	
public voidtruncate(long pos)

see
java.sql.Blob#truncate(long)

		excep();