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

## things.thinger.io
Class StreamSourceFromStream

    java.lang.Object
      things.thinger.io.StreamSourceFromStream

All Implemented Interfaces:
  StreamSource

    public class StreamSourceFromStream

extends java.lang.Object
implements StreamSource

A character stream source. It will tee a single character, so be sure the underlying stream will starve it (pass EOF) if it should cross a barrier and read something it isn't allowed to have. See the HeaderProcessor for an example of how to do this.

Version:
  1.0

  Version History

      EPG - Initial (toolkit) - 7 SEP 03

Author:
  Erich P. Gatejen

Constructor Summary
`StreamSourceFromStream()` A null constructor.
`StreamSourceFromStream(java.io.InputStream source)` Constructor.

Method Summary
`boolean` | `hasMore()` Does the source have more to get?
`int` | `next()` Get the next character.
`void` | `reuse(java.io.InputStream source)` Reuse this object but with another stream.

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

Constructor Detail

### StreamSourceFromStream

    public StreamSourceFromStream()

  A null constructor. You must call reuse() before the other methods or they will throw exceptions.

### StreamSourceFromStream

    public StreamSourceFromStream(java.io.InputStream source)
                           throws java.lang.Exception

  Constructor. Pass the stream to source.

  Parameters:
    `source` - the input stream source.
  Throws:
    `java.lang.Exception`

Method Detail

### reuse

    public void reuse(java.io.InputStream source)
               throws java.lang.Exception

  Reuse this object but with another stream. Since we anticipate using a lot of these, this should spare some heap thrash.

  Parameters:
    `source` - The input stream source.
  Throws:
    `java.lang.Exception`

### next

    public int next()
             throws java.lang.Exception

  Get the next character. It'll throw an EOFException if there is nothing left.

  Specified by:
    `next` in interface `StreamSource`
  Returns:
    the next character
  Throws:
    `java.lang.Exception`

### hasMore

    public boolean hasMore()
                    throws java.lang.Exception

  Does the source have more to get?

  Specified by:
    `hasMore` in interface `StreamSource`
  Returns:
    true if it does, otherwise false.
  Throws:
    `java.lang.Exception`

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

Things.