Package java.io

Examples of java.io.OutputStreamWriter


    // To write the global count of each term
    final OutputBitStream outputGlobCounts = writeGlobCounts ? new OutputBitStream( outputBasename + DiskBasedIndex.GLOBCOUNTS_EXTENSION ) : null;
    // To write the frequency of each term
    final OutputBitStream frequencies = new OutputBitStream( outputBasename + DiskBasedIndex.FREQUENCIES_EXTENSION );
    // To write the new term list
    final PrintWriter termFile = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream( outputBasename + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ), bufferSize ) );
   
    // The current term
    MutableString currTerm;
   
    // Total number of pointers and occurrences
View Full Code Here


      final DefaultTagDescription tags = new DefaultTagDescription();
      tags.setDefaultNamespace(DrillDownModule.DRILLDOWN_PROFILE_NAMESPACE);
      tags.addDefaultDefinition(DrillDownModule.DRILLDOWN_PROFILE_NAMESPACE, false);
      tags.addTagDefinition(DrillDownModule.DRILLDOWN_PROFILE_NAMESPACE, "attribute", true);

      final XmlWriter w = new XmlWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"), tags);
      w.writeXmlDeclaration("UTF-8");

      final AttributeList rootList = new AttributeList();
      rootList.addNamespaceDeclaration("", DrillDownModule.DRILLDOWN_PROFILE_NAMESPACE);
      w.writeTag(DrillDownModule.DRILLDOWN_PROFILE_NAMESPACE, "drilldown-profiles", rootList, XmlWriter.OPEN);
View Full Code Here

    if ( ASSERTS ) assert numTerms == termMap.size();
    if ( ! indexingIsVirtual ) sizes.close();

    // We sort the terms appearing in the batch and write them on disk.
    ObjectArrays.quickSort( termArray );
    final PrintWriter pw = new PrintWriter( new OutputStreamWriter( new FastBufferedOutputStream( new FileOutputStream( batchBasename + DiskBasedIndex.TERMS_EXTENSION ), bufferSize ), "UTF-8" ) );
    for ( MutableString t : termArray ) t.println( pw );
    pw.close();

    try {
      final OutputBitStream frequencies = new OutputBitStream( batchBasename + DiskBasedIndex.FREQUENCIES_EXTENSION );
View Full Code Here

   
    final PrintWriter[] localTerms = new PrintWriter[ numIndices ];
    final int numTerms[] = new int[ numIndices ];
    final FastBufferedReader terms = new FastBufferedReader( new InputStreamReader( new FileInputStream( inputBasename + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ) );
   
    for( int i = 0; i < numIndices; i++ ) localTerms[ i ] = new PrintWriter( new OutputStreamWriter( new FastBufferedOutputStream( new FileOutputStream( localBasename[ i ] + DiskBasedIndex.TERMS_EXTENSION ) ), "UTF-8" ) );

    // The current term
    final MutableString currTerm = new MutableString();
   
    pl.itemsName = "terms";
View Full Code Here

    for( int i = 0; i < numIndices; i++ ) {
      localIndexStream[ i ] = new OutputBitStream( localBasename[ i ] + DiskBasedIndex.INDEX_EXTENSION, bufferSize );
      if ( isHighPerformance ) localPositionsStream[ i ] = new OutputBitStream( localBasename[ i ] + DiskBasedIndex.POSITIONS_EXTENSION, bufferSize );
      localFrequencies[ i ] = new OutputBitStream( localBasename[ i ] + DiskBasedIndex.FREQUENCIES_EXTENSION );
      localGlobCounts[ i ] = new OutputBitStream( localBasename[ i ] + DiskBasedIndex.GLOBCOUNTS_EXTENSION );
      localTerms[ i ] = new PrintWriter( new OutputStreamWriter( new FastBufferedOutputStream( new FileOutputStream( localBasename[ i ] + DiskBasedIndex.TERMS_EXTENSION ) ), "UTF-8" ) );
      localOffsets[ i ] = new OutputBitStream( localBasename[ i ] + DiskBasedIndex.OFFSETS_EXTENSION );
      if ( posNumBits != null ) localPosNumBits[ i ] = new OutputBitStream( localBasename[ i ] + DiskBasedIndex.POSITIONS_NUMBER_OF_BITS_EXTENSION );
      localOffsets[ i ].writeGamma( 0 );
    }
View Full Code Here

      else if ( ! skips ) indexWriter[ i ] = new BitStreamIndexWriter( localBasename[ i ], strategy.numberOfDocuments( i ), true, writerFlags );
      else indexWriter[ i ] = new SkipBitStreamIndexWriter( localBasename[ i ], strategy.numberOfDocuments( i ), true, skipBufferSize, writerFlags, quantum, height );
     
      if ( haveCounts ) localGlobCounts[ i ] = new OutputBitStream( name + DiskBasedIndex.GLOBCOUNTS_EXTENSION );
      localFrequencies[ i ] = new OutputBitStream( name + DiskBasedIndex.FREQUENCIES_EXTENSION );
      localTerms[ i ] = new PrintWriter( new BufferedWriter( new OutputStreamWriter( new FileOutputStream( localBasename[ i ] + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ) ) );     
    }
   
    terms = new FastBufferedReader( new InputStreamReader( new FileInputStream( inputBasename + DiskBasedIndex.TERMS_EXTENSION ), "UTF-8" ) );
  }
View Full Code Here

    final OutputStream outputStream = new BufferedOutputStream(bundle.createEntry(contentState.getFileName(),
        "text/xml"));
    final DefaultTagDescription tagDescription =
        new DefaultTagDescription(ClassicEngineBoot.getInstance().getGlobalConfig(), BundleXmlModule.TAG_DEF_PREFIX);
    final XmlWriter writer = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), tagDescription, "  ", "\n");
    writer.writeXmlDeclaration("UTF-8");

    final AttributeList rootAttributes = new AttributeList();
    rootAttributes.addNamespaceDeclaration("", BundleNamespaces.DATADEFINITION);
View Full Code Here

    // prepare anything that might needed to be prepared ..
    final String encoding = metaData.getConfiguration().getConfigProperty
        ("org.pentaho.reporting.engine.classic.core.modules.output.pageable.xml.Encoding",
            EncodingRegistry.getPlatformDefaultEncoding());

    final Writer writer = new BufferedWriter(new OutputStreamWriter(outputStream, encoding));
    this.xmlWriter = new XmlWriter(writer, td);
    this.xmlWriter.writeXmlDeclaration(null);
    final AttributeList attrs = new AttributeList();
    attrs.addNamespaceDeclaration("", XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE);
    xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "layout-output", attrs, XmlWriter.OPEN);
View Full Code Here

      throw new IOException("Unable to generate unique name for the direct Static-Data-Source");
    }
    final OutputStream outputStream = bundle.createEntry(fileName, "text/xml");
    final DefaultTagDescription tagDescription = new DefaultTagDescription(
        ClassicEngineBoot.getInstance().getGlobalConfig(), StaticDataFactoryModule.TAG_DEF_PREFIX);
    final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), tagDescription, "  ",
        "\n");
    xmlWriter.writeXmlDeclaration("UTF-8");

    final AttributeList rootAttrs = new AttributeList();
    rootAttrs.addNamespaceDeclaration("data", StaticDataFactoryModule.NAMESPACE);
View Full Code Here

    }

    final OutputStream outputStream = bundle.createEntry(fileName, "text/xml");
    final DefaultTagDescription tagDescription = new DefaultTagDescription(
        ClassicEngineBoot.getInstance().getGlobalConfig(), StaticDataFactoryModule.TAG_DEF_PREFIX);
    final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), tagDescription, "  ",
        "\n");
    xmlWriter.writeXmlDeclaration("UTF-8");

    final AttributeList rootAttrs = new AttributeList();
    rootAttrs.addNamespaceDeclaration("data", StaticDataFactoryModule.NAMESPACE);
View Full Code Here

TOP

Related Classes of java.io.OutputStreamWriter

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.