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 org.jredis.ri.alphazero.support.FastBufferedInputStream

         * @param socketInputStream
         * @return
         */
        @SuppressWarnings("boxing")
      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(Connection.Socket.Property.SO_RCVBUF));
          }
          return in;
        }
    View Full Code Here

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

      {
       
    //    BlockingDequeDataSource datasource = new BlockingDequeDataSource(_dataQueue);
    //    InputStreamDataSource datasource = new InputStreamDataSource(inStream, BUFF_SIZE);
    //    DataSourceInputStream in = new DataSourceInputStream(datasource, BUFF_SIZE);
        FastBufferedInputStream in = new FastBufferedInputStream(inStream, BUFF_SIZE);
       
        Response.Type   responseType = null;
        Pending     pending = null;
        long  mark=System.currentTimeMillis();
        long   delta=0;
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

            return oldValue;
        }

        public static PropertyMap load(File file) throws IOException {
            FileInputStream fis = new FileInputStream(file);
            FastBufferedInputStream bis = new FastBufferedInputStream(fis, 4096);
            DataInputStream dis = new DataInputStream(bis);

            final int totalEntries = dis.readInt();
            final int duplicateEntries = dis.readInt();
            ConcurrentMap<String, String> entries = new ConcurrentHashMap<String, String>((totalEntries >>> 1) * 3); // totalSize * 3/2       
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

            try {
                remoteIs = _proxy.fetch(_fetchSize);
            } catch (RemoteException e) {
                throw new XQRemoteException(e);
            }
            final FastBufferedInputStream bufferedIs = new FastBufferedInputStream(remoteIs);
            final int fetched = fetchInternal(bufferedIs);
            return fetched;
        }
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

            try {
                remoteIs = _proxy.asyncFetch(_fetchSize);
            } catch (RemoteException e) {
                throw new XQRemoteException(e);
            }
            final FastBufferedInputStream bufferedIs = new FastBufferedInputStream(remoteIs);
            final ObjectInputStream ois;
            try {
                ois = new ObjectInputStream(bufferedIs);
            } catch (IOException e) {
                throw new IllegalStateException(e);
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

            try {
                fis = new FileInputStream(cacheFile);
            } catch (FileNotFoundException e) {
                throw new IllegalStateException(e);
            }
            final FastBufferedInputStream bis = new FastBufferedInputStream(fis);
            Object obj = ObjectUtils.readObjectQuietly(bis);
            return (Map<MutableString, Long>) obj;
        }
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

            }
        }

        public void loadDocument(InputStream is) throws XQueryException {
            if(!(is instanceof FastBufferedInputStream)) {
                is = new FastBufferedInputStream(is);
            }
            _handler.init();
            final StopWatch sw = new StopWatch();
            try {
                _reader.parse(new InputSource(is));
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

                    try {
                        fis = new FileInputStream(file);
                    } catch (FileNotFoundException e) {
                        throw new IllegalStateException();
                    }
                    final FastBufferedInputStream bis = new FastBufferedInputStream(fis, 4096);
                    this.recordMap = ObjectUtils.readObjectQuietly(bis);
                    IOUtils.closeQuietly(bis);
                } else {
                    this.recordMap = new Long2LongOpenHash(cacheSize, 0.7f, 1.9f);
                }
    View Full Code Here

    Examples of xbird.util.io.FastBufferedInputStream

            try {
                fis = new FileInputStream(cacheFile);
            } catch (FileNotFoundException e) {
                throw new IllegalStateException(e);
            }
            final FastBufferedInputStream bis = new FastBufferedInputStream(fis);
            Object obj = ObjectUtils.readObject(bis);
            return (Map<MutableString, Long>) obj;
        }
    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.