com.sun.jini.mercury
Class EventReader.SwitchInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.sun.jini.mercury.EventReader.SwitchInputStream
All Implemented Interfaces:
Closeable
Enclosing class:
EventReader

private static class EventReader.SwitchInputStream
extends InputStream

This class is intended to be the InputStream provided to EventInputStream's constructor. This class essentially delegates InputStream functionality to the provided InputStream. The setInputStream method allows the underlying InputStream to be re-targeted at runtime.


Field Summary
private  InputStream in
          The delegation target for the InputStream methods
 
Constructor Summary
EventReader.SwitchInputStream(InputStream in)
          Simple constructor that assigns the given argument to the appropriate internal field.
 
Method Summary
 int available()
           
 void close()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void setInputStream(InputStream in)
          Sets the delegation target
 long skip(long n)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

private InputStream in
The delegation target for the InputStream methods

Constructor Detail

EventReader.SwitchInputStream

public EventReader.SwitchInputStream(InputStream in)
Simple constructor that assigns the given argument to the appropriate internal field.

Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

setInputStream

public void setInputStream(InputStream in)
Sets the delegation target



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.