Examples of FastBufferedInputStream

Warning: Since fastutil 6.0.0, this class detects a implementations of {@link MeasurableStream} instead of subclasses MeasurableInputStream (which is deprecated). @since 4.4

  • org.jredis.ri.alphazero.support.FastBufferedInputStream
    Extension of {@link java.io.InputStream} that uses the enclosing instance's{@link InputStream} its data source. This is not supposed to be a general purposeimplementation. @author Joubin Houshyar (alphazero@sensesay.net) @version alpha.0, Sep 5, 2009 @since alpha.0
  • xbird.util.io.FastBufferedInputStream
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods. When the BufferedInputStream is created, an internal buffer array is created. As bytes from the stream are read or skipped, the internal buffer is refilled as necessary from the contained input stream, many bytes at a time. The mark operation remembers a point in the input stream and the reset operation causes all the bytes read since the most recent mark operation to be reread before new bytes are taken from the contained input stream. @version 1.57, 06/07/06

  • Examples of it.unimi.dsi.fastutil.io.FastBufferedInputStream

        final boolean openStream = fbis == null;
        if ( openStream ){
          f = Arrays.binarySearch( firstDocument, index );
          if ( f < 0 ) f = -f - 2;
          fbis = new FastBufferedInputStream( new FileInputStream( file[ f ] ) );
        }

        long start = pointers.get( f ).getLong( index - firstDocument[ f ] );
        fbis.position( start );
        final long end = pointers.get( f ).getLong( index - firstDocument[ f ] + 1 );
    View Full Code Here

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

      }


      public Document getDocument( InputStream rawContent, Reference2ObjectMap<Enum<?>,Object> metadata ) throws IOException {
       
        final FastBufferedInputStream fbis = new FastBufferedInputStream( rawContent );
        int startedHeader = 0; // 0 == false, 1 == true, 2 === header started and uri collected
        boolean foundDocNo = false;
       
        int l = fbis.readLine( buffer );
        if ( l < 0 ) throw new EOFException();
        if ( ! TRECDocumentCollection.equals( buffer, l, DOC_OPEN  ) ) throw new IllegalStateException ( "Document does not start with <DOC>: " + new String( buffer, 0, l ) );
       
        while ( ( l = fbis.readLine( buffer ) ) != -1 ) {
          if ( !foundDocNo && startsWith( buffer, l, DOCNO_OPEN ) ) {
            foundDocNo = true;
            metadata.put( MetadataKeys.TITLE, new String( buffer, DOCNO_OPEN.length, l - ( DOCNO_OPEN.length + DOCNO_CLOSE.length ) ) );
          }
    View Full Code Here

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

         */
        @Override
        protected void parseContent(final int fileIndex, InputStream is, final DataOutputStream metadataStream) throws IOException {
            LOGGER.debug("Processing files %d (%s)", fileIndex, files[fileIndex]);
            checkBuffers();
            FastBufferedInputStream fbis = new FastBufferedInputStream(is,
                    bufferSize);
            final boolean debugEnabled = LOGGER.isDebugEnabled();

            EventHandler handler = new EventHandler() {
                @Override
    View Full Code Here

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

    public class CatTRECDocument extends AbstractTask {
        static final Logger logger = Logger.getLogger(CatTRECDocument.class);

        @Override
        public int execute() throws Throwable {
            FastBufferedInputStream in = new FastBufferedInputStream(System.in);

            byte[] buffer = new byte[8192];
            byte[] docnoBuffer = new byte[512];

            Charset charset = Charset.forName("ISO-8859-1");
    View Full Code Here

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

          int max = min + step;

          System.out.println (start);
          l.output("START " + inFile);

          final FastBufferedInputStream in =
        new FastBufferedInputStream(new FileInputStream (new File(inFile)));

          GZWarcRecord record = new GZWarcRecord();
          Filter<WarcRecord> filter = Filters.adaptFilterBURL2WarcRecord (new TrueFilter());
          WarcFilteredIterator it = new WarcFilteredIterator(in, record, filter);
    View Full Code Here

    Examples of org.jredis.ri.alphazero.support.FastBufferedInputStream

      protected final InputStream newInputStream (InputStream socketInputStream) throws IllegalArgumentException {
         
          InputStream in = super.newInputStream(socketInputStream);
          if(!(in instanceof FastBufferedInputStream)){
            System.out.format("WARN: input was: %s\n", in.getClass().getCanonicalName());
            in = new FastBufferedInputStream (in, spec.getSocketProperty(SocketProperty.SO_RCVBUF));
          }
          return in;
        }
    View Full Code Here

    Examples of org.jredis.ri.alphazero.support.FastBufferedInputStream

      protected final InputStream newInputStream (InputStream socketInputStream) throws IllegalArgumentException {

        InputStream in = super.newInputStream(socketInputStream);
        if(!(in instanceof FastBufferedInputStream)){
          System.out.format("WARN: input was: %s\n", in.getClass().getCanonicalName());
          in = new FastBufferedInputStream (in, spec.getSocketProperty(Connection.Socket.Property.SO_RCVBUF));
        }
        return in;
      }
    View Full Code Here

    Examples of org.jredis.ri.alphazero.support.FastBufferedInputStream

         * with buffer size matching the SO_RCVBUF property of the {@link Connection}'s {@link ConnectionSpec}
         * @param socketInputStream
         * @return
         */
        protected InputStream newInputStream(InputStream socketInputStream) {
          return  new FastBufferedInputStream(socketInputStream, spec.getSocketProperty(SO_RCVBUF));
        }
    View Full Code Here

    Examples of org.jredis.ri.alphazero.support.FastBufferedInputStream

      protected final InputStream newInputStream (InputStream socketInputStream) throws IllegalArgumentException {
         
          InputStream in = super.newInputStream(socketInputStream);
          if(!(in instanceof FastBufferedInputStream)){
            System.out.format("WARN: input was: %s\n", in.getClass().getCanonicalName());
            in = new FastBufferedInputStream (in, spec.getSocketProperty(SocketProperty.SO_RCVBUF));
          }
          return in;
        }
    View Full Code Here

    Examples of org.jredis.ri.alphazero.support.FastBufferedInputStream

      protected final InputStream newInputStream (InputStream socketInputStream) throws IllegalArgumentException {
         
          InputStream in = super.newInputStream(socketInputStream);
          if(!(in instanceof FastBufferedInputStream)){
            Log.log(String.format("WARN: input was: %s\n", in.getClass().getCanonicalName()));
            in = new FastBufferedInputStream (in, spec.getSocketProperty(Connection.Socket.Property.SO_RCVBUF));
          }
          return in;
        }
    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.