-
Class System is class of
java.lang
-
class System encapsulates...
... several aspects of the run-time environment
-
System contains predefined stream variables:
in, out, and err
-
in, out, and err declared as:
This means:
- public, final, and static within System
- This means they can be used by any other part of your program and without reference to a specific System object.
-
System.out refers to the...
Which is by default ...
- ... standard output stream
- ... console
-
System.in refers to the ...
Which is by default ...
- ... standard input stream
- ... keyboard
-
System.err refers to the ...
Which is by default ...
- ... standard error stream
- ... console
-
System.in is an object of type ...
... InputStream
-
System.out is an object of type
... PrintStream
-
System.err is an object of type ...
... PrintStream
-
InputStream is a class of ...
java.io.InputStream
-
PrintStreamis a class of ...
java.io.OutputStream.FilterOutputStream.PrintStream
-
System.in is an instance of ...
- ... InputStream,
- so automatically have access to the methods defined by InputStream
-
System.out is instance of ...
- PrintStream,
- so automatically have access to the methods defined by PrintStream
-
System.err is instance of ...
- PrintStream,
- so automatically have access to the methods defined by PrintStream
-
Methods of java.io.InputStream (9)
- 1 - int available()
- 2 - void close()
- 3 - void mark(int readlimit)
- 4 - boolean markSupported()
- 5 - abstract int read()
- 6 - int read(byte[ ] b)
- 7 - int read(byte[ ] b, int off, int len)
- 8 - void reset()
- 9 - long skip(long n)
-
Returns number of bytes currently available for reading
- int available()
- java.io.InputStream
-
int available()
- java.io.InputStream
- Returns number of bytes currently available for reading
-
Closes this input source
- void close()
- java.io.InputStream
-
void close()
- java.io.InputStream
- Closes this input source
-
Places a marks at the current point in the input stream that will remain valid until "readlimit" bytes are read
- void mark(int readlimit)
- java.io.InputStream
-
void mark(int readlimit)
- java.io.InputStream
- Places a marks at the current point in the input stream that will remain valid until "readlimit" bytes are read
-
Returns "true" if this input stream supports the mark and reset methods
- boolean markSupported()
- java.io.InputStream
-
boolean markSupported()
- java.io.InputStream
- Returns "true" if this input stream supports the mark and reset methods
-
Reads the next byte of data from the input stream.
- abstract int read()
- java.io.InputStream
-
abstract int read()
- java.io.InputStream
- Reads the next byte of data from the input stream.
-
Reads some number of bytes from the input stream and stores them into the buffer array b
- int read(byte[ ] b)
- java.io.InputStream
-
int read(byte[ ] b)
- java.io.InputStream
- Reads some number of bytes from the input stream and stores them into the buffer array b
-
Attempts to reads up to "len" bytes of data from the input stream into buffer array "b" starting at "b[off]"
- int read(byte[ ] b, int off, int len)
- java.io.InputStream
-
int read(byte[ ] b, int off, int len)
- java.io.InputStream
- Attempts to reads up to "len" bytes of data from the input stream into buffer array "b" starting at "b[off]"
-
Resets the input pointer to the previously "set" mark
- void reset()
- java.io.InputStream
-
void reset()
- java.io.InputStream
- Resets the input pointer to the previously "set" mark
-
Skips over and discards n bytes of data from this input stream.
- long skip(long n)
- java.io.InputStream
-
long skip(long n)
- java.io.InputStream
- Skips over and discards n bytes of data from this input stream.
-
Methods of java.io.OutputStream (5)
- 1 - void close()
- 2 - void flush()
- 3 - void write(int b)
- 4 - void write(byte[ ] b)
- 5 - void write(byte[ ] b, int off, int len)
-
Closes this output stream
- void close()
- java.io.OutputStream
-
void close()
- java.io.OutputStream
- Closes this output stream
-
Causes any output that has been buffered to be sent to its destination. That is "flashes" the output buffer
- void flush()
- java.io.OutputStream
-
void flush()
- java.io.OutputStream
- Causes any output that has been buffered to be sent to its destination. That is "flashes" the output buffer
-
Writes the single specified byte to this output stream
- void write(int b)
- java.io.OutputStream
-
void write(int b)
- java.io.OutputStream
- Writes the single specified byte to this output stream
-
Writes b.length bytes from the specified byte array to this output stream
- void write(byte[ ] b)
- java.io.OutputStream
-
void write(byte[ ] b)
- java.io.OutputStream
- Writes b.length bytes from the specified byte array to this output stream
-
Writes "len" bytes from the specified byte array starting at offset "off" to this output stream
- void write(byte[ ] b, int off, int len)
- java.io.OutputStream
-
void write(byte[ ] b, int off, int len)
- java.io.OutputStream
- Writes "len" bytes from the specified byte array starting at offset "off" to this output stream
|
|