FreeHEP API
Version current

org.freehep.util.io
Class RoutedInputStream.Route

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.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.

Source Code:
RoutedInputStream.Route.java

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.

Throws:
IOException

close

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

Throws:
IOException

getStart

public byte[] getStart()
Returns start marker.


getEnd

public byte[] getEnd()
Returns end marker.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.