Package lejos.remote.nxt
Class NXTInputStream
- java.lang.Object
-
- java.io.InputStream
-
- lejos.remote.nxt.NXTInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NXTInputStream extends java.io.InputStreamExtends InputStream for BlueTooth; implements available()- Author:
- Roger Glassey revised on june 23, 2007, modified for Bluetooth2
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()returns the number of bytes in the input buffer - can be read without blockingvoidclose()the stream is restored to its original state - ready to receive more data.intread()Returns one byte as an integer between 0 and 255.intread(byte[] b, int off, int len)
-
-
-
Method Detail
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOExceptionReturns one byte as an integer between 0 and 255. Returns -1 if the end of the stream is reached. Does not return till some bytes are available.- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOExceptionreturns the number of bytes in the input buffer - can be read without blocking- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close()
the stream is restored to its original state - ready to receive more data.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
-