Section One
Reading data from InputStream using commandLines
1. Command-Line Arguments Any Java technology application can use command-line arguments. • These string arguments are placed on the command line to launch the Java interpreter after the class name:
2. I/O Stream Fundamentals A stream is a flow of data from a source or to a sink A source stream initiates the flow of data, also called an input stream. A sink stream terminates the flow of data, also called an output stream. Sources and sinks are also called Input streams and output streams Types of node streams are files, memory, and pipes between threads or processes.
I. System.in.Read() Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. A subclass must provide an implementation of this method. Returns: the next byte of data, or -1 if the end of the stream is reached. II. System.in. available ()
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes. Returns: An estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|