Examples of FastBufferedOutputStream


Examples of com.ibm.commons.util.io.FastBufferedOutputStream

     * @param node the source node
     * @param format the desired output format
     */
    public static void serialize( File file, Node node, Format format) throws XMLException {
        try {
            OutputStream os = new FastBufferedOutputStream(new FileOutputStream(file));
            try {
                serialize(os, node, format);
            } finally {
                os.close();
            }
        } catch(IOException e) {
//TODO - after resource bundle clarification            throw new XMLException(e, "Error while saving XML to file '{0}'", file.getPath()); //$NLS-DOMUtil.JDOMUtil.XmlSavingToFile.Exception-1$
            throw new XMLException(e,"JDOMUtil.XmlSavingToFile.Exception"+file.getPath()); // $NON-NLS-1$
        }
View Full Code Here

Examples of de.netseeker.ejoe.io.FastBufferedOutputStream

     * @see de.netseeker.ejoe.adapter.SerializeAdapter#write(java.lang.Object, java.io.OutputStream)
     */
    public void write( Object obj, OutputStream out ) throws Exception
    {
        ObjectSerializer serializer = new ObjectSerializer();
        FastBufferedOutputStream bOut = new FastBufferedOutputStream( out );
        try
        {
            serializer.serializeToOutputStream( obj, bOut );
        }
        finally
View Full Code Here

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

   */
  public RemoteIndexServerConnection( final SocketAddress address, final byte command ) throws IOException {
    socket = new Socket();
    socket.connect( address );
    inputStream = new DataInputStream( new FastBufferedInputStream( socket.getInputStream() ) );
    outputStream = new DataOutputStream( new FastBufferedOutputStream( socket.getOutputStream() ) );
    outputStream.writeByte( command );
    outputStream.flush();
  }
View Full Code Here

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

   
    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

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

    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

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

    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

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

  }
   
  public void open( final CharSequence suffix ) throws IOException {
    basenameSuffix = basename + suffix;
    documentsOutputBitStream = new OutputBitStream( basenameSuffix + SimpleCompressedDocumentCollection.DOCUMENTS_EXTENSION );
    termsOutputStream = new CountingOutputStream( new FastBufferedOutputStream( new FileOutputStream( basenameSuffix + SimpleCompressedDocumentCollection.TERMS_EXTENSION ) ) );
    nonTermsOutputStream = exact ? new CountingOutputStream( new FastBufferedOutputStream( new FileOutputStream( basenameSuffix + SimpleCompressedDocumentCollection.NONTERMS_EXTENSION ) ) ) : null;
    documentOffsetsObs = new OutputBitStream( basenameSuffix + SimpleCompressedDocumentCollection.DOCUMENT_OFFSETS_EXTENSION );
    termOffsetsObs = new OutputBitStream( basenameSuffix + SimpleCompressedDocumentCollection.TERM_OFFSETS_EXTENSION );
    nonTermOffsetsObs = exact? new OutputBitStream( basenameSuffix + SimpleCompressedDocumentCollection.NONTERM_OFFSETS_EXTENSION ) : null;
    fieldContent = new IntArrayList();

    if ( hasNonText ) nonTextZipDataOutputStream = new DataOutputStream( nonTextZipOutputStream = new ZipOutputStream( new FastBufferedOutputStream( new FileOutputStream( basenameSuffix + ZipDocumentCollection.ZIP_EXTENSION ) ) ) );

    terms.clear();
    terms.trim( Scan.INITIAL_TERM_MAP_SIZE );
    if ( exact ) {
      nonTerms.clear();
View Full Code Here

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

    Matcher matcher = pattern.matcher( "" );
   
    final int h = jsapResult.getInt( "h" );
    final String basename = jsapResult.getString( "basename" );
    final PrintStream printStream[] = new PrintStream[ h + 1 ];
    for( int i = 0; i <= h; i++ ) printStream[ i ] = new PrintStream( new FastBufferedOutputStream( new FileOutputStream( basename + "-" + i + DiskBasedIndex.STATS_EXTENSION ) ) );
   
    final MutableString line = new MutableString();
    final FastBufferedReader reader = new FastBufferedReader( new InputStreamReader( System.in ) );
   
    int l, start;
View Full Code Here

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

    FastBufferedInputStream termsStream = new FastBufferedInputStream( new FileInputStream( basename + TERMS_EXTENSION ) ) ;
    MutableString term[] = new MutableString[ (int)collection.terms ];
    for( int i = 0; i < term.length; i++ ) term[ i ] = new MutableString().readSelfDelimUTF8( termsStream );
    termsStream.close();

    new FastBufferedOutputStream( new FileOutputStream( basename + TERMS_EXTENSION ) );
  }
View Full Code Here

Examples of it.unimi.dsi.fastutil.io.FastBufferedOutputStream

    Util.ensureLog4JIsConfigured();

    final DocumentIterator documentIterator = documentSequence.iterator();

    Document document;
    FastBufferedOutputStream uriStream = null, titleStream = null;
   
    if ( jsapResult.userSpecified( "uris" ) ) uriStream = new FastBufferedOutputStream( new FileOutputStream( jsapResult.getString( "uris" ) ) );
    if ( jsapResult.userSpecified( "titles" ) ) titleStream = new FastBufferedOutputStream( new FileOutputStream( jsapResult.getString( "titles" ) ) );
   
    MutableString s = new MutableString();

    ProgressLogger progressLogger = new ProgressLogger( LOGGER, jsapResult.getLong( "logInterval" ), "documents" );
    if ( documentSequence instanceof DocumentCollection ) progressLogger.expectedUpdates = ((DocumentCollection)documentSequence).size();
    progressLogger.start( "Scanning..." );
   
    while( ( document = documentIterator.nextDocument() ) != null ) {
      if ( uriStream != null ) {
        s.replace( document.uri() );
        s.replace( LINE_TERMINATORS, SPACES );
        s.writeUTF8( uriStream );
        uriStream.write( '\n' );
      }
      if ( titleStream != null ) {
        s.replace( document.title() );
        s.replace( LINE_TERMINATORS, SPACES );
        s.writeUTF8( titleStream );
        titleStream.write( '\n' );
      }
      progressLogger.lightUpdate();
    }
   
    progressLogger.done();
    if ( uriStream != null ) uriStream.close();
    if ( titleStream != null ) titleStream.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.