freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

通信工程專業(yè)畢業(yè)論文--android手機(jī)電子書閱讀器的設(shè)計(jì)與實(shí)現(xiàn)-在線瀏覽

2025-07-25 04:28本頁面
  

【正文】 ng It抯 helpful to categorize the clas ses by their functionality In Java lo the library designers started by deciding that all classes that had anything to do with input would be inherited from InputStream and all classes that were associated with output would be inherited from OutputStream Type of InputStream InputStreams job is to represent classes that produce input from different sourcesThese sources can be An array of bytes A String obj ect A file A pipe which works like a physical pipe You put things in at one end and they e out the other A sequence of other streams so you can collect them together into a single stream Other sources such as an Internet connection This is covered in Thinking in Enterprise Java available at Each of these has an associated subclass of InputStream In addition the FilterInputStream is also a type of InputStream to provide a base class for decorator classes that attach attribute or useful interfaces to input streamsTypes of OutputStreamThis category includes the classes that decide where your output will go an array of bytes but not a Stringpresumably you can create one using the array of bytes a file or a pipe In addition the FilterOutputStream provides a base class for decorator classes that attach attributes or useful interfaces to output streams This is discussed laterAdding attributes and useful interfaces Decorators were introduced in the Generics chapter on page 717 The Java IO library requires many different binations of features and this is the justification for using the Decorator design pattern1 The reason for the existence of the filter classes in the Java IO library is that the abstract filter class is the base class for all the decorators A decorator must have the same interface as the object it decorates but the decorator can also extend the interface which occurs in several of the filter classes There is a drawback to Decorator however Decorators give you much more flexibility while youre writing a program since you can easily mix and match attributes but they add plexity to your code The reason that the Java IO library is awkward to use is that you must create many classesthe core IO type plus all the decoratorsin order to get the single IO object that you want The classes that provide the decorator interface to control a particular InputStream or OutputStream are the FilterlnputStream and FilterOutputStream which dont have very intuitive names FilterlnputStream and FilterOutputStream are derived from the base classes of the IO library InputStream and OutputStream which is a key requirement of the decorator so that it provides the mon interface to all the objects that are being decorated Readers Writers Java 11 made significant modifications to the fundamental IO stream library When you see the Reader and Writer classes your first thought like mine might be that these were meant to replace the InputStream and OutputStream classes But thats not the case Although some aspects of the original streams library are deprecated if you use them you will receive a warning from the piler the InputStream and OutputStream classes still provide valuable functionality in the form of byteoriented IO whereas the Reader and Writer classes provide Unicodepliant characterbased IO In addition Java 11 added new classes into the InputStream and OutputStream hierarchy so its obvious those hierarchies werent being replaced There are times when you must use classes from the byte hierarchy in bination with classes in the character hierarchy To acplish this there are adapter classes InputStreamReader converts an InputStream to a Reader and OutputStreamWriter converts an OutputStream to a WriterThe most important reason for the Reader and Writer hierarchies is for internationalization The old IO stream hierarchy supports only 8bit byte streams and doesnt handle the 16bit Unicode characters well Since Unicode is used for internationalization and Javas native char is 16bit Unicode the Reader and Writer hierarchies were added to support Unicode in all IO operations In addition the new libraries are designed for faster operations than the oldStandard IO The term standard IO refers to the Unix concept of a single stream of information that is used by a program this idea is reproduced in some form in Windows and many other operating systems All of the programs input can e from standard input all of its output can go to standard output and all of its error messages can be sent to standard error The value of standard IO is that programs can easily be chained together and one programs standard output can bee the standard input for another program This is a powerful toolReading from standard input Following the standard IO model Java has Systemin Systemout and Systemerr Throughout this book youve seen how to write to standard output using Systemout which is already prewrapped as a PrintStream object Systemerr is likewise a PrintStream but Systemin is a raw InputStream with no wrapping This means that although you can use Systemout and Systemerr right away Systemin must be wrapped before you can read from it Youll typically read input a line at a time using readLine To do this wrap Systemin in a BufferedReader which requires you to convert Systemin to a Reader using InputStreamReaderRedirecting The Java System class allows you to redirect the standard input output and error IO streams using simple static method calls setIn InputStream setOut PrintStream setErr PrintStream Redirecting output is especially useful if you suddenly start creating a large amount of output on your screen and its scrolling past faster than you can read it4 Redirecting input is valuable for a ma
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1