@Override public void close() throws IOException { try { if (!saved && !read) { byte[] bytes = new byte[1<<13]; while (!saved) { read(bytes, 0, bytes.length); } } fsos.close(); } finally { if (!saved) { fsisf.free(); saved = true; } super.close(); } }
@Override public void close() throws IOException { try { if (!saved && !read) { byte[] bytes = new byte[1<<13]; while (!saved) { read(bytes, 0, bytes.length); } } fsos.close(); } finally { if (!saved) { fsisf.free(); saved = true; } super.close(); } }
@Override public void close() throws IOException { try { if (!saved && !read) { byte[] bytes = new byte[1<<13]; while (!saved) { read(bytes, 0, bytes.length); } } fsos.close(); } finally { if (!saved) { fsisf.free(); saved = true; } super.close(); } }
byte[] b = new byte[DataTypeManager.MAX_LOB_MEMORY_BYTES + 1]; fsos.write(b); fsos.close(); BlobType blob1 = new BlobType(new BlobImpl(fsisf));
/** * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{ if (this.result == null) { return null; } try { this.result.getWriter().close(); FileStoreOutputStream fs = this.result.getOuputStream(); fs.close(); if (binary) { if (fs.bytesWritten()) { return new BlobType(new BlobImpl(result)); } return new BlobType(new SerialBlob(Arrays.copyOf(fs.getBuffer(), fs.getCount()))); } if (fs.bytesWritten()) { return new ClobType(new ClobImpl(result, -1)); } return new ClobType(new ClobImpl(new String(Arrays.copyOf(fs.getBuffer(), fs.getCount()), Streamable.ENCODING))); } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30422, e); } catch (SQLException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30423, e); } } }
/** * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{ if (this.result == null) { this.result = buildResult(commandContext); } try { this.result.getWriter().close(); FileStoreOutputStream fs = this.result.getOuputStream(); fs.close(); if (binary) { if (fs.bytesWritten()) { return new BlobType(new BlobImpl(result)); } return new BlobType(new SerialBlob(Arrays.copyOf(fs.getBuffer(), fs.getCount()))); } if (fs.bytesWritten()) { return new ClobType(new ClobImpl(result, -1)); } return new ClobType(new ClobImpl(new String(Arrays.copyOf(fs.getBuffer(), fs.getCount()), Streamable.ENCODING))); } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30422, e); } catch (SQLException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30423, e); } } }
/** * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{ if (this.result == null) { return null; } try { this.result.getWriter().close(); FileStoreOutputStream fs = this.result.getOuputStream(); fs.close(); if (binary) { if (fs.bytesWritten()) { return new BlobType(new BlobImpl(result)); } return new BlobType(new SerialBlob(Arrays.copyOf(fs.getBuffer(), fs.getCount()))); } if (fs.bytesWritten()) { return new ClobType(new ClobImpl(result, -1)); } return new ClobType(new ClobImpl(new String(Arrays.copyOf(fs.getBuffer(), fs.getCount()), Streamable.ENCODING))); } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30422, e); } catch (SQLException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30423, e); } } }
/** * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{ if (this.result == null) { this.result = buildResult(commandContext); } try { FileStoreOutputStream fs = this.result.getOuputStream(); fs.close(); if (fs.bytesWritten()) { return new BlobType(new BlobImpl(result)); } return new BlobType(new SerialBlob(Arrays.copyOf(fs.getBuffer(), fs.getCount()))); } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30422, e); } catch (SQLException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30423, e); } } }
/** * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{ if (this.result == null) { this.result = buildResult(commandContext); } try { FileStoreOutputStream fs = this.result.getOuputStream(); fs.close(); if (fs.bytesWritten()) { return new BlobType(new BlobImpl(result)); } return new BlobType(new SerialBlob(Arrays.copyOf(fs.getBuffer(), fs.getCount()))); } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30422, e); } catch (SQLException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30423, e); } } }
/** * @see org.teiid.query.function.aggregate.AggregateFunction#getResult(CommandContext) */ public Object getResult(CommandContext commandContext) throws TeiidProcessingException{ if (this.result == null) { this.result = buildResult(commandContext); } try { FileStoreOutputStream fs = this.result.getOuputStream(); fs.close(); if (fs.bytesWritten()) { return new BlobType(new BlobImpl(result)); } return new BlobType(new SerialBlob(Arrays.copyOf(fs.getBuffer(), fs.getCount()))); } catch (IOException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30422, e); } catch (SQLException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30423, e); } } }