ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

org.jboss.shrinkwrap.impl.base.exporter
Class FutureCompletionInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.PipedInputStream
          extended by org.jboss.shrinkwrap.impl.base.exporter.FutureCompletionInputStream
Type Parameters:
T - Response type of the Future
All Implemented Interfaces:
Closeable

public class FutureCompletionInputStream
extends PipedInputStream

PipedInputStream which, when fully-read, will block upon a Future and report any exceptional circumstances to the owning Thread.

Author:
ALR

Field Summary
 
Fields inherited from class java.io.PipedInputStream
buffer, in, out, PIPE_SIZE
 
Constructor Summary
FutureCompletionInputStream(Future<?> job)
          Creates a new Stream
 
Method Summary
 int read()
          
 int read(byte[] b, int off, int len)
          
 
Methods inherited from class java.io.PipedInputStream
available, close, connect, receive
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FutureCompletionInputStream

public FutureCompletionInputStream(Future<?> job)
Creates a new Stream

Method Detail

read

public int read()
         throws IOException

Overrides:
read in class PipedInputStream
Throws:
IOException
See Also:
PipedInputStream.read()

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException

Overrides:
read in class PipedInputStream
Throws:
IOException
See Also:
PipedInputStream.read(byte[], int, int)

ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.