@Override protected void writeReference(final DataOutput out) throws IOException { try { BlobType.writeBinary(out, getBinaryStream(), (int)length); } catch (SQLException e) { throw new IOException(); } }
@Override protected void writeReference(final DataOutput out) throws IOException { try { BlobType.writeBinary(out, getBinaryStream(), (int)length); } catch (SQLException e) { throw new IOException(); } }
@Override long computeLength() throws SQLException { if (this.reference instanceof SQLXMLImpl) { SQLXMLImpl impl = (SQLXMLImpl)this.reference; return impl.length(); } return BaseLob.length(getBinaryStream()); }
@Override long computeLength() throws SQLException { if (this.reference instanceof SQLXMLImpl) { SQLXMLImpl impl = (SQLXMLImpl)this.reference; return impl.length(); } return BaseLob.length(getBinaryStream()); }
/** * Create a object which can create a sequence of LobChunk objects on a given * LOB object * @throws SQLException */ private ByteLobChunkStream createLobStream(String referenceStreamId) throws TeiidComponentException, SQLException { // get the reference object in the buffer manager, and try to stream off // the original sources. Streamable<?> streamable = parent.resultsBuffer.getLobReference(referenceStreamId); if (streamable instanceof XMLType) { XMLType xml = (XMLType)streamable; return new ByteLobChunkStream(xml.getBinaryStream(), chunkSize); } else if (streamable instanceof ClobType) { ClobType clob = (ClobType)streamable; return new ByteLobChunkStream(new ReaderInputStream(clob.getCharacterStream(), Charset.forName(Streamable.ENCODING)), chunkSize); } BlobType blob = (BlobType)streamable; return new ByteLobChunkStream(blob.getBinaryStream(), chunkSize); }
/** * Create a object which can create a sequence of LobChunk objects on a given * LOB object * @throws SQLException */ private ByteLobChunkStream createLobStream(String referenceStreamId) throws TeiidComponentException, SQLException { // get the reference object in the buffer manager, and try to stream off // the original sources. Streamable<?> streamable = parent.resultsBuffer.getLobReference(referenceStreamId); if (streamable instanceof XMLType) { XMLType xml = (XMLType)streamable; return new ByteLobChunkStream(xml.getBinaryStream(), chunkSize); } else if (streamable instanceof BaseClobType) { BaseClobType clob = (BaseClobType)streamable; return new ByteLobChunkStream(new ReaderInputStream(clob.getCharacterStream(), Charset.forName(Streamable.ENCODING)), chunkSize); } BlobType blob = (BlobType)streamable; return new ByteLobChunkStream(blob.getBinaryStream(), chunkSize); }
/** * Create a object which can create a sequence of LobChunk objects on a given * LOB object * @throws SQLException */ private ByteLobChunkStream createLobStream(String referenceStreamId) throws TeiidComponentException, SQLException { // get the reference object in the buffer manager, and try to stream off // the original sources. Streamable<?> streamable = parent.resultsBuffer.getLobReference(referenceStreamId); if (streamable instanceof XMLType) { XMLType xml = (XMLType)streamable; return new ByteLobChunkStream(xml.getBinaryStream(), chunkSize); } else if (streamable instanceof BaseClobType) { BaseClobType clob = (BaseClobType)streamable; return new ByteLobChunkStream(new ReaderInputStream(clob.getCharacterStream(), Charset.forName(Streamable.ENCODING)), chunkSize); } BlobType blob = (BlobType)streamable; return new ByteLobChunkStream(blob.getBinaryStream(), chunkSize); }
is = new ReaderInputStream(value.getCharacterStream(), encoding); } else { is = value.getBinaryStream();
is = new ReaderInputStream(value.getCharacterStream(), encoding); } else { is = value.getBinaryStream();
is = new ReaderInputStream(value.getCharacterStream(), encoding); } else { is = value.getBinaryStream();