public static class InputStream extends Object
Most clients will use input streams that read data from the file system
(FileInputStream
), the network (Socket.getInputStream()
/URLConnection.getInputStream()
), or from an in-memory byte
array (ByteArrayInputStream
).
Use InputStreamReader
to adapt a byte stream like this one into a
character stream.
Most clients should wrap their input stream with BufferedInputStream
. Callers that do only bulk reads may omit buffering.
Some implementations support marking a position in the input stream and
resetting back to this position later. Implementations that don't return
false from #markSupported()
and throw an IOException
when
#reset()
is called.
FilterInputStream
, which delegates all calls to the source input
stream.
All input stream subclasses should override both read()
and read(byte[],int,int)
. The
three argument overload is necessary for bulk access to the data. This is
much more efficient than byte-by-byte access.
OutputStream
,
Serialized FormCopyright © 2018. All rights reserved.