/** * Returns the number of bytes. */ public long length() throws SQLException{ if (getStreamFactory().getLength() == -1) { getStreamFactory().setLength(length(getBinaryStream())); } return getStreamFactory().getLength(); }
public Reader getCharacterStream() throws SQLException { try { Reader r = this.getStreamFactory().getCharacterStream(); if (r != null) { return r; } } catch (IOException e) { SQLException ex = new SQLException(e.getMessage()); ex.initCause(e); throw ex; } Charset cs = getCharset(); if (cs == null) { cs = Streamable.CHARSET; } return new InputStreamReader(getBinaryStream(), cs.newDecoder()); }
@Override public Charset getCharset() { Charset cs = super.getCharset(); if (cs != null) { return cs; } String enc = null; try { enc = XMLType.getEncoding(this.getBinaryStream()); } catch (SQLException e) { } if (enc != null) { setEncoding(enc); } else { super.setCharset(Streamable.CHARSET); } return super.getCharset(); }
public InputStream getBinaryStream() throws SQLException { try { return this.getStreamFactory().getInputStream(); } catch (IOException e) { SQLException ex = new SQLException(e.getMessage()); ex.initCause(e); throw ex; } }
Reference param, Object value) throws QueryResolverException { try { InputStreamFactory isf = ((BaseLob)value).getStreamFactory(); InputStream initial = isf.getInputStream(); InputStream other = isf.getInputStream(); ((BaseLob) value).setStreamFactory(is.getInputStreamFactory()); } else { initial.close();
@Override public InputStream getInputStream() throws IOException { List<InputStream> streams = new ArrayList<InputStream>(ew.includes.size() * 2 + 1); long last = 0; for (int i = 0; i < ew.includes.size(); i++) { Include include = ew.includes.get(i); streams.add(fsisf.getInputStream(last, include.start - last)); last = include.start; try { streams.add(((BaseLob)include.streamable.getReference()).getBinaryStream()); } catch (SQLException e) { throw new IOException(e); } } streams.add(fsisf.getInputStream(last, -1)); return new SequenceInputStream(Collections.enumeration(streams)); }
@Override long computeLength() throws SQLException { if (this.reference instanceof SQLXMLImpl) { SQLXMLImpl impl = (SQLXMLImpl)this.reference; return impl.length(); } return BaseLob.length(getBinaryStream()); }
public InputStream getBinaryStream() throws SQLException { try { return this.getStreamFactory().getInputStream(); } catch (IOException e) { SQLException ex = new SQLException(e.getMessage()); ex.initCause(e); throw ex; } }
Reference param, Object value) throws QueryResolverException { try { InputStreamFactory isf = ((BaseLob)value).getStreamFactory(); InputStream initial = isf.getInputStream(); InputStream other = isf.getInputStream(); ((BaseLob) value).setStreamFactory(is.getInputStreamFactory()); } else { initial.close();
@Override public InputStream getInputStream() throws IOException { List<InputStream> streams = new ArrayList<InputStream>(ew.includes.size() * 2 + 1); long last = 0; for (int i = 0; i < ew.includes.size(); i++) { Include include = ew.includes.get(i); streams.add(fsisf.getInputStream(last, include.start - last)); last = include.start; try { streams.add(((BaseLob)include.streamable.getReference()).getBinaryStream()); } catch (SQLException e) { throw new IOException(e); } } streams.add(fsisf.getInputStream(last, -1)); return new SequenceInputStream(Collections.enumeration(streams)); }
@Override long computeLength() throws SQLException { if (this.reference instanceof SQLXMLImpl) { SQLXMLImpl impl = (SQLXMLImpl)this.reference; return impl.length(); } return BaseLob.length(getBinaryStream()); }
public static void setTemporary(Object lob, boolean temp) { if (lob instanceof Streamable<?>) { setTemporary(((Streamable<?>)lob).getReference(), temp); } if (lob instanceof BaseLob) { BaseLob baseLob = (BaseLob)lob; try { baseLob.getStreamFactory().setTemporary(temp); } catch (SQLException e) { } } }
/** * Returns the number of bytes. */ public long length() throws SQLException{ if (getStreamFactory().getLength() == -1) { getStreamFactory().setLength(length(getBinaryStream())); } return getStreamFactory().getLength(); }
public Reader getCharacterStream() throws SQLException { try { Reader r = this.getStreamFactory().getCharacterStream(); if (r != null) { return r; } } catch (IOException e) { SQLException ex = new SQLException(e.getMessage()); ex.initCause(e); throw ex; } Charset cs = getCharset(); if (cs == null) { cs = Streamable.CHARSET; } return new InputStreamReader(getBinaryStream(), cs.newDecoder()); }
Reference param, Object value) throws QueryResolverException { try { InputStreamFactory isf = ((BaseLob)value).getStreamFactory(); InputStream initial = isf.getInputStream(); InputStream other = isf.getInputStream(); ((BaseLob) value).setStreamFactory(is.getInputStreamFactory()); } else { initial.close();
@Override public InputStream getInputStream() throws IOException { List<InputStream> streams = new ArrayList<InputStream>(ew.includes.size() * 2 + 1); long last = 0; for (int i = 0; i < ew.includes.size(); i++) { Include include = ew.includes.get(i); streams.add(fsisf.getInputStream(last, include.start - last)); last = include.start; try { streams.add(((BaseLob)include.streamable.getReference()).getBinaryStream()); } catch (SQLException e) { throw new IOException(e); } } streams.add(fsisf.getInputStream(last, -1)); return new SequenceInputStream(Collections.enumeration(streams)); }
@Override public Charset getCharset() { Charset cs = super.getCharset(); if (cs != null) { return cs; } String enc = null; try { enc = XMLType.getEncoding(this.getBinaryStream()); } catch (SQLException e) { } if (enc != null) { setEncoding(enc); } else { super.setCharset(Streamable.CHARSET); } return super.getCharset(); }
public static void setTemporary(Object lob, boolean temp) { if (lob instanceof Streamable<?>) { setTemporary(((Streamable<?>)lob).getReference(), temp); } if (lob instanceof BaseLob) { BaseLob baseLob = (BaseLob)lob; try { baseLob.getStreamFactory().setTemporary(temp); } catch (SQLException e) { } } }
public static StorageMode getStorageMode(Object lob) { if (lob instanceof Streamable<?>) { return getStorageMode(((Streamable<?>)lob).getReference()); } if (lob instanceof SerialClob) { return StorageMode.MEMORY; } if (lob instanceof SerialBlob) { return StorageMode.MEMORY; } if (lob instanceof BaseLob) { BaseLob baseLob = (BaseLob)lob; try { return baseLob.getStreamFactory().getStorageMode(); } catch (SQLException e) { return StorageMode.FREE; } } return StorageMode.OTHER; }
public static StorageMode getStorageMode(Object lob) { if (lob instanceof Streamable<?>) { return getStorageMode(((Streamable<?>)lob).getReference()); } if (lob instanceof SerialClob) { return StorageMode.MEMORY; } if (lob instanceof SerialBlob) { return StorageMode.MEMORY; } if (lob instanceof BaseLob) { BaseLob baseLob = (BaseLob)lob; try { return baseLob.getStreamFactory().getStorageMode(); } catch (SQLException e) { return StorageMode.FREE; } } return StorageMode.OTHER; }