Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Apache CXF API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cxf.io
Class AbstractThresholdOutputStream

    java.lang.Object
      java.io.OutputStream
          org.apache.cxf.io.AbstractWrappedOutputStream
              org.apache.cxf.io.AbstractThresholdOutputStream

All Implemented Interfaces:
  java.io.Closeable, java.io.Flushable

    public abstract class AbstractThresholdOutputStream

extends AbstractWrappedOutputStream

Outputstream that will buffer a certain amount before writing anything to the underlying stream. When the threshold is reached, provides a callback point to allow the subclass to update headers, replace/set the output stream, etc... Also provides a callback for when the stream is closed without it reaching the threshold.

Field Summary
`protected org.apache.cxf.helpers.LoadingByteArrayOutputStream` | `buffer`
`protected int` | `threshold`

Fields inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
`wrappedStream, written`

Constructor Summary
`AbstractThresholdOutputStream(int threshold)`

Method Summary
`void` | `close()`
`abstract void` | `thresholdNotReached()`
`abstract void` | `thresholdReached()`
`void` | `unBuffer()`
`void` | `write(byte[] b, int off, int len)`
`void` | `write(int b)`

Methods inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
`flush, onFirstWrite, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### threshold

    protected int threshold

### buffer

    protected org.apache.cxf.helpers.LoadingByteArrayOutputStream buffer

Constructor Detail

### AbstractThresholdOutputStream

    public AbstractThresholdOutputStream(int threshold)

Method Detail

### thresholdReached

    public abstract void thresholdReached()
                                   throws java.io.IOException

  Throws:
    `java.io.IOException`

### thresholdNotReached

    public abstract void thresholdNotReached()
                                      throws java.io.IOException

  Throws:
    `java.io.IOException`

### write

    public void write(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException

  Overrides:
    `write` in class `AbstractWrappedOutputStream`
  Throws:
    `java.io.IOException`

### write

    public void write(int b)
               throws java.io.IOException

  Overrides:
    `write` in class `AbstractWrappedOutputStream`
  Throws:
    `java.io.IOException`

### unBuffer

    public void unBuffer()
                  throws java.io.IOException

  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Specified by:
    `close` in interface `java.io.Closeable`
  Overrides:
    `close` in class `AbstractWrappedOutputStream`
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Apache CXF API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Apache CXF