SunSPOT host API V5.0


com.sun.spot.peripheral
Class BoundedInputStream

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


Constructor Summary
BoundedInputStream(InputStream in)
          Construct an instance based on the supplied parent InputStream.
 
Method Summary
 int available()
           
 void close()
           
 int read()
           
 
Methods inherited from class java.io.InputStream
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

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
Method Detail

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

SunSPOT host API V5.0


Copyright © 2006-2008 Sun Microsystems, Inc. All Rights Reserved.