com.sun.jini.jeri.internal.http
Class Request.ContentInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.sun.jini.jeri.internal.http.Request.ContentInputStream
All Implemented Interfaces:
Closeable
Enclosing class:
Request

private class Request.ContentInputStream
extends InputStream

Stream for reading inbound request/response data.


Constructor Summary
private Request.ContentInputStream()
           
 
Method Summary
 int available()
           
private  boolean checkOpen()
          Checks to make sure stream is open and startInput has been called.
 void close()
           
private  void close(boolean checkAbort)
          Attempts to close stream.
private  void invalidate(Throwable cause)
          Invalidates stream, saving cause.
 int read()
           
 int read(byte[] b, int off, int len)
           
 
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

Request.ContentInputStream

private Request.ContentInputStream()
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

checkOpen

private boolean checkOpen()
                   throws IOException
Checks to make sure stream is open and startInput has been called. Returns false if EOF has been reached, true otherwise. Assumes caller already possesses inLock monitor.

Throws:
IOException

close

private void close(boolean checkAbort)
            throws IOException
Attempts to close stream. If checkAbort is true and the request has been aborted, close will fail with an IOException.

Throws:
IOException

invalidate

private void invalidate(Throwable cause)
                 throws IOException
Invalidates stream, saving cause. If other stream is done, finishes request. Assumes caller already possesses inLock monitor.

Throws:
IOException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.