Package org.teiid.common.buffer

Examples of org.teiid.common.buffer.FileStoreInputStreamFactory


  }

  private FileStoreInputStreamFactory buildResult() throws TeiidProcessingException {
    try {
      FileStore fs = context.getBufferManager().createFileStore("textagg"); //$NON-NLS-1$
      FileStoreInputStreamFactory fisf = new FileStoreInputStreamFactory(fs, textLine.getEncoding()==null?Streamable.ENCODING:textLine.getEncoding());
      Writer w = fisf.getWriter();
      if (textLine.isIncludeHeader()) {
        w.write(TextLine.evaluate(textLine.getExpressions(), new TextLine.ValueExtractor<DerivedColumn>() {
          public Object getValue(DerivedColumn t) {
            if (t.getAlias() == null && t.getExpression() instanceof ElementSymbol) {
              return ((ElementSymbol)t.getExpression()).getShortName();
View Full Code Here


          buffer.skipBytes(2);
         
          if (stream == null) {
            store = storageManager.createFileStore("temp-stream"); //$NON-NLS-1$
            StreamFactoryReference sfr = streams.get(streamIndex);
            sfr.setStreamFactory(new FileStoreInputStreamFactory(store, Streamable.ENCODING));
            this.stream = new BufferedOutputStream(store.createOutputStream());
          }
          if (dataLen == 0) {
            stream.close();
            stream = null;
View Full Code Here

   */
  public static SQLXMLImpl saveToBufferManager(BufferManager bufferMgr, XMLTranslator translator)
      throws TeiidComponentException, TeiidProcessingException {       
      boolean success = false;
      final FileStore lobBuffer = bufferMgr.createFileStore("xml"); //$NON-NLS-1$
      FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(lobBuffer, Streamable.ENCODING);
      try
        Writer writer = fsisf.getWriter();
          translator.translate(writer);
          writer.close();
          success = true;
          return new SQLXMLImpl(fsisf);
      } catch(IOException e) {
View Full Code Here

    private FileStoreInputStreamFactory fsisf;
    private FileStore fs;
   
    public XmlConcat(BufferManager bm) throws TeiidProcessingException {
      fs = bm.createFileStore("xml"); //$NON-NLS-1$
      fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING);
        writer = fsisf.getWriter();
      factory = getOutputFactory();
      try {
        eventWriter = factory.createXMLEventWriter(writer);
      } catch (XMLStreamException e) {
View Full Code Here

      if (value instanceof InputStreamFactory) {
        return new BlobType(new BlobImpl((InputStreamFactory)value));
      }
      FileStore fs = dtm.getBufferManager().createFileStore("bytes"); //$NON-NLS-1$
      //TODO: guess at the encoding from the content type
      FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING);
     
      try {
        ObjectConverterUtil.write(fsisf.getOuputStream(), ((DataSource)value).getInputStream(), -1);
      } catch (IOException e) {
        throw new TransformationException(e, e.getMessage());
      }
      return new BlobType(new BlobImpl(fsisf));
    }
View Full Code Here

    private boolean finished;
    private boolean isFormatted = MappingNodeConstants.Defaults.DEFAULT_FORMATTED_DOCUMENT.booleanValue();
    private SQLXMLImpl xml;
   
    public DocumentInProgress(FileStore store, String encoding) throws TeiidComponentException{
      final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(store, encoding);
        this.xml = new SQLXMLImpl(fsisf);
        this.xml.setEncoding(encoding);
        SAXTransformerFactory factory = new TransformerFactoryImpl();
        try {
      //SAX2.0 ContentHandler
      handler = factory.newTransformerHandler();
      handler.setResult(new StreamResult(fsisf.getOuputStream()));
    } catch (Exception e) {
      throw new TeiidComponentException(e);
    }
        transformer = handler.getTransformer();
        transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
View Full Code Here

TOP

Related Classes of org.teiid.common.buffer.FileStoreInputStreamFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.