com.sun.spot.peripheral
Class BoundedInputStream
java.lang.Object
java.io.InputStream
com.sun.spot.peripheral.BoundedInputStream
- All Implemented Interfaces:
- Closeable
public class BoundedInputStream
- extends InputStream
Wraps a parent InputStream with an input stream on the assumptions
that the first four bytes of the parent's content are a Java int which tells us
how many more valid bytes remain in the parent.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedInputStream
public BoundedInputStream(InputStream in)
throws IOException
- Construct an instance based on the supplied parent
InputStream.
- Parameters:
in - the parent input stream (see class comment)
- Throws:
IOException
read
public int read()
throws IOException
- Specified by:
read in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class InputStream
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available in class InputStream
- Throws:
IOException
Copyright © 2006-2008 Sun Microsystems, Inc. All Rights Reserved.