Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.w3c.www.mux
Class MuxOutputStream

    java.lang.Object
      |
      +--java.io.OutputStream
            |
            +--org.w3c.www.mux.MuxOutputStream

public class MuxOutputStream
extends java.io.OutputStream

Field Summary
`protected int` | `avail_credit` The currently available credit.
`protected boolean` | `closed` Has this stream been closed ?
`protected static boolean` | `debug`
`protected int` | `fragsz` The current max allowed fragment size.
`protected int` | `sessid` The identifier of above session (fast access).
`protected MuxSession` | `session` The session this stream is attached to.
`protected org.w3c.www.mux.MuxWriter` | `writer` The writer instance for the multiplexed stream.

Constructor Summary
`protected` | `MuxOutputStream(MuxSession session)`

Method Summary
`void` | `close()` Close that session output stream.
`void` | `flush()` Flush that output stream, blocking all data has been sent.
`protected void` | `notifyControl(int control)` Callback notifying the the frgament size has changed.
`protected void` | `notifyCredit(int credit)` Callback notifying that more credit is available for that stream.
`void` | `write(byte[] b, int off, int len)` Writes a sub array of bytes.
`void` | `write(int b)` Writes a byte.

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`

Field Detail

### debug

    protected static final boolean debug

### session

    protected MuxSession session

  The session this stream is attached to.

### sessid

    protected int sessid

  The identifier of above session (fast access).

### writer

    protected org.w3c.www.mux.MuxWriter writer

  The writer instance for the multiplexed stream.

### fragsz

    protected int fragsz

  The current max allowed fragment size.

### avail_credit

    protected int avail_credit

  The currently available credit.

### closed

    protected boolean closed

  Has this stream been closed ?

Constructor Detail

### MuxOutputStream

    protected MuxOutputStream(MuxSession session)

Method Detail

### notifyCredit

    protected void notifyCredit(int credit)

  Callback notifying that more credit is available for that stream.
  Parameters:
    `credit` - The credit we are getting from our peer.

### notifyControl

    protected void notifyControl(int control)

  Callback notifying the the frgament size has changed.
  Parameters:
    `control` - The new fragment size.

### write

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

  Writes a byte. This method will block until the byte is actually written. It is highly recomended that you use a buffered output stream on top of that stream, or that you don't use that method.
  Parameters:
    `b` - the byte
  Throws:
    java.io.IOException - If an I/O error has occurred.
  Overrides:
    write in class java.io.OutputStream

### write

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

  Writes a sub array of bytes.
  Parameters:
    `b` - the data to be written
    `off` - the start offset in the data
    `len` - the number of bytes that are written
  Throws:
    java.io.IOException - If an I/O error has occurred.
  Overrides:
    write in class java.io.OutputStream

### flush

    public void flush()
               throws java.io.IOException

  Flush that output stream, blocking all data has been sent.
  Throws:
    java.io.IOException - If some IO errors occur.
  Overrides:
    flush in class java.io.OutputStream

### close

    public void close()
               throws java.io.IOException

  Close that session output stream.
  Throws:
    java.io.IOException - If some IO errors occur.
  Overrides:
    close in class java.io.OutputStream

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD