FreeHEP API
Version v1.2.2

org.freehep.util.io
Class RoutedInputStream.Route

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.freehep.util.io.RoutedInputStream.Route
Enclosing class:
RoutedInputStream

public class RoutedInputStream.Route
extends InputStream

Route which can be read up to and including the end marker. When you close the route, all bytes including the end marker will be read/discarded before returning. If you just discard the Route, the underlying stream will still return you all or part of the bytes of this route. If the end marker is set to null, the stream can be read until the underlying stream ends.


Constructor Summary
RoutedInputStream.Route(byte[] start, byte[] end)
          Creates a route with given start and end marker.
 
Method Summary
 void close()
          Closes the stream, and discards any bytes up to and including the end marker.
 byte[] getEnd()
          Returns end marker.
 byte[] getStart()
          Returns start marker.
 int read()
          Returns bytes of this specific route, starting with the start marker, followed by any bytes up to and including the end marker.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoutedInputStream.Route

public RoutedInputStream.Route(byte[] start,
                               byte[] end)
Creates a route with given start and end marker.

Method Detail

read

public int read()
         throws IOException
Returns bytes of this specific route, starting with the start marker, followed by any bytes up to and including the end marker. If the end marker is null, the route is indefinite.

Specified by:
read in class InputStream
IOException

close

public void close()
           throws IOException
Closes the stream, and discards any bytes up to and including the end marker.

Overrides:
close in class InputStream
IOException

getStart

public byte[] getStart()
Returns start marker.


getEnd

public byte[] getEnd()
Returns end marker.


FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.