Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## lejos.nxt.comm
Class NXTInputStream

    java.lang.Object
      java.io.InputStream
          lejos.nxt.comm.NXTInputStream

    public class NXTInputStream

extends InputStream

Extends InputStream for BlueTooth; implements available()

Author:
  Roger Glassey revised on june 23, 2007, modified for Bluetooth2

Method Summary
`int` | `available()` returns the number of bytes in the input buffer - can be read without blocking
`void` | `close()` the stream is restored to its original state - ready to receive more data.
`int` | `read()` Returns one byte as an integer between 0 and 255.

Methods inherited from class java.io.InputStream
`mark, markSupported, read, read, reset, skip`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait`

Method Detail

### read

    public int read()

  Returns 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:
    `read` in class `InputStream`
  Returns:
    the next byte of data, or `-1` if the end of the stream is reached.

### available

    public int available()

  returns the number of bytes in the input buffer - can be read without blocking

  Overrides:
    `available` in class `InputStream`
  Returns:
    the number of bytes that can be read from this input stream without blocking.

### close

    public void close()

  the stream is restored to its original state - ready to receive more data.

  Overrides:
    `close` in class `InputStream`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD