public Blob createBlob() throws SQLException { return new MockBlob(new byte[0]); }
public long position(Blob pattern, long start) throws SQLException { return position(pattern.getBytes(1, (int)pattern.length()), start); }
public byte[] getBytes(long pos, int length) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } length = verifyAndFixLength(pos, length); return ArrayUtil.getByteArrayFromList(blobData, (int)(pos - 1), length); }
public boolean equals(Object obj) { if(null == obj) return false; if(!obj.getClass().equals(this.getClass())) return false; MockBlob other = (MockBlob)obj; if(wasFreeCalled != other.wasFreeCalled()) return false; return blobData.equals(other.blobData); }
@Override public boolean equals(Object obj) { if(null == obj) return false; if(!obj.getClass().equals(this.getClass())) return false; MockBlob other = (MockBlob)obj; if(wasFreeCalled != other.wasFreeCalled()) return false; return blobData.equals(other.blobData); }
public Blob createBlob() throws SQLException { return new MockBlob(new byte[0]); }
public byte[] getBytes(long pos, int length) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } length = verifyAndFixLength(pos, length); return ArrayUtil.getByteArrayFromList(blobData, (int)(pos - 1), length); }
public boolean equals(Object obj) { if(null == obj) return false; if(!obj.getClass().equals(this.getClass())) return false; MockBlob other = (MockBlob)obj; if(wasFreeCalled != other.wasFreeCalled()) return false; return blobData.equals(other.blobData); }
public long position(Blob pattern, long start) throws SQLException { return position(pattern.getBytes(1, (int)pattern.length()), start); }
public Blob createBlob() throws SQLException { return new MockBlob(new byte[0]); }
public InputStream getBinaryStream(long pos, long length) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } length = verifyAndFixLength(pos, (int)length); return new ByteArrayInputStream(ArrayUtil.getByteArrayFromList(blobData, (int)(pos - 1), (int)length)); }
public long position(Blob pattern, long start) throws SQLException { return position(pattern.getBytes(1, (int)pattern.length()), start); }
public void setBlob(String parameterName, InputStream inputStream) throws SQLException { byte[] data = StreamUtil.getStreamAsByteArray(inputStream); setBlob(parameterName, new MockBlob(data)); }
public byte[] getBytes(long pos, int length) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } length = verifyAndFixLength(pos, length); return ArrayUtil.getByteArrayFromList(blobData, (int)(pos - 1), length); }
public void updateBlob(String columnName, InputStream stream, long length) throws SQLException { byte[] data = StreamUtil.getStreamAsByteArray(stream, (int)length); updateBlob(columnName, new MockBlob(data)); }
public InputStream getBinaryStream(long pos, long length) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } length = verifyAndFixLength(pos, (int)length); return new ByteArrayInputStream(ArrayUtil.getByteArrayFromList(blobData, (int)(pos - 1), (int)length)); }
public void updateBlob(String columnName, InputStream stream, long length) throws SQLException { byte[] data = StreamUtil.getStreamAsByteArray(stream, (int)length); updateBlob(columnName, new MockBlob(data)); }
public InputStream getBinaryStream(long pos, long length) throws SQLException { if(wasFreeCalled) { throw new SQLException("free() was called"); } length = verifyAndFixLength(pos, (int)length); return new ByteArrayInputStream(ArrayUtil.getByteArrayFromList(blobData, (int)(pos - 1), (int)length)); }
public void updateBlob(String columnName, InputStream stream) throws SQLException { byte[] data = StreamUtil.getStreamAsByteArray(stream); updateBlob(columnName, new MockBlob(data)); }
public Blob getBlob(int parameterIndex) throws SQLException { Object value = getObject(parameterIndex); if(null != value) { if(value instanceof Blob) return (Blob)value; return new MockBlob(getBytes(parameterIndex)); } return null; }