com.github.croesch.micro_debug.mic1.io
Class Input

java.lang.Object
  extended by com.github.croesch.micro_debug.mic1.io.Input

public final class Input
extends Object

This class represents the connection to the input of the mic1-processor. It is called buffered, because it reads one line and provides single bytes from the read input to the reader.

Since:
Date: Nov 26, 2011
Author:
croesch

Method Summary
static byte read()
          Reads a single byte from the given input stream.
static void reset()
          Resets the internal buffer, so that the next call of read() will cause an invocation of the underlying InputStream.
static void setIn(InputStream stream)
          Sets the input stream for the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setIn

public static void setIn(InputStream stream)
Sets the input stream for the component. The processor will now read from the given stream.

Parameters:
stream - the new input stream, mustn't be null
Since:
Date: Nov 27, 2011

read

public static byte read()
Reads a single byte from the given input stream. If the buffer is empty this will include reading a complete line from the input stream.

Returns:
the byte value of the read byte,
or -1 if the stream doesn't return anything to read.
Since:
Date: Nov 27, 2011

reset

public static void reset()
Resets the internal buffer, so that the next call of read() will cause an invocation of the underlying InputStream.

Since:
Date: Feb 10, 2012


Copyright © 2012. All Rights Reserved.