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

java.lang.Object
  extended by java.io.OutputStream
      extended by com.sun.jini.jeri.internal.http.Request.ContentOutputStream
All Implemented Interfaces:
Closeable, Flushable
Enclosing class:
Request

private class Request.ContentOutputStream
extends OutputStream

Stream for writing outbound request/response data.


Constructor Summary
private Request.ContentOutputStream()
           
 
Method Summary
private  void checkOpen()
          Checks to make sure stream is open and startOutput has been called.
 void close()
           
private  void close(boolean checkAbort)
          Attempts to close stream.
 void flush()
           
private  void invalidate(Throwable cause)
          Invalidates stream, saving cause.
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request.ContentOutputStream

private Request.ContentOutputStream()
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

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

checkOpen

private void checkOpen()
                throws IOException
Checks to make sure stream is open and startOutput has been called. Assumes caller already possesses outLock 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 outLock monitor.

Throws:
IOException


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