com.sun.jini.mercury
Class EventReader.SwitchInputStream
java.lang.Object
java.io.InputStream
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
private InputStream in
- The delegation target for the InputStream methods
EventReader.SwitchInputStream
public EventReader.SwitchInputStream(InputStream in)
- Simple constructor that assigns the given argument to the
appropriate internal field.
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.