Follow our Telegram channel to get notified instantly whenever new books are published.
Java 2 Black Book – Steve Holzner (1)

Where do I start?” “You start,” you say, “with the InputStream and OutputStream classes.” The InputStream and OutputStream classes are the base classes for byte- oriented I/O in Java, so it’s worth taking a look at the methods that these classes provide to all other byte-oriented stream classes.
Here’s the inheritance diagram for the InputStream class, on which you base input streams: 1/0 Handling = c— ” = (=7) — = = ° — ae = Streams: File and java.lang.Object |___java.io.InputStream You’ll find the constructor of the InputStream class in Table 11.4 and its meth- ods in Table 11.5. We’ll take a look at the OutputStream class in the next solution.
Table 11.4 The constructor of the InputStream class. InputStream() Constructs an InputStream object. Table 11.5 Methods of the InputStream class. @ int available() Gets the number of bytes that can be read from this input stream. void close() Closes this input stream. void mark(int readlimit) Marks the current position in this input stream, boolean markSupported() Returns True if this input stream supports the mark and reset methods.
abstract int read() Reads the next byte of data from the input stream. int read(byte[] b) Reads some number of bytes from the input stream and stores them into the buffer array b. int read(byte[] b, int off, int len) Reads up to len bytes of data from the input stream into an array of bytes. void reset() Repositions this stream to the position where the mark method was last called on this input stream. long skip(long n) Skips over n bytes of data from this input stream.
Immediate Solutions Working with OutputStream The counterpart to the InputStream class, introduced in the previous solution, is the OutputStream class, on which you base output streams. Here’s the inher- itance diagram for OutputStream: java.lang.Object | java.io.QutputStream You’ll find the constructor of the OutputStream class in Table 11.6 and its meth- ods in Table 11.7. Now that you’ve seen InputStream and OutputStream, it’s time to put these classes to work, starting in the next solution.
Table 11.6 The constructor of the Output Stream class. Sone see OutputStream() Constructs an OutputStream object. Table 11.7 Methods of the OutputStream class. void close() Closes this output stream. void flush() Flushes this output stream and writes any waiting buffered output bytes.
‘Immediate Solutions” is what the cover says and, immediate solutions are exactly what Visual Basic programmers get. No timewasting, no schleppy tutorials, but excellent demonstrations on how do get things done! —Raj Phanse M.S., Applications Engineer Huntington Beach, CA I have found information in this book pertaining to functions that I didn’t even know about. I have found my first reading of a Coriolis publication to be ex- tremely enjoyable. You now have a dedicated reader.
Keep up the good work. —Cali L. LaFollett, Programmer Bloomington, IL Finally a to-the-point, how-to reference book that cuts through the mire. The scenarios used are typical, hence useful…the book is three weeks old and already has dog-eared pages, thanks! —Brian Nickel, Data Engineering * Tampa, FL Excellent, handy book to have next to your computer! A must-have for a serious programmer. —Hanh D. Nguyen, Ph.D., Senior Scientist State College, PA If you have comments about this book or other Coriolis Technology Press books, please send them to us via [email protected].
We hope to hear from you! JAVA 2 Black Book Steven Holzner Y) CORIOLIS’ Publisher Steve Sayre Acquisitions Editor Kevin Weeks Product Marketing Manager Tracy Rooney Project Editor Hilary Long Technical Reviewer J. Brook Monroe Andrew Indovina Production Coordinator Peggy Cantrell Cover Designer Laura Wellander Layout Designer April Nielsen CD-ROM Developer Chris Nusbaum ) CORIOLIS” Java 2 Black Book © 2001 The Coriolis Group. All rights reserved. . This book may not be duplicated in any way without the express written consent of the publisher, except in the form of brief excerpts or quotations for the purposes of review.
The information contained herein is for the personal use of the reader and may not be incorporated in any commercial programs, other books, databases, or any kind of software without written consent of the publisher. Making copies of this book or any portion for any purpose other than your own is a violation of United States copyright laws.
Limits of Liability and Disclaimer of Warranty The author and publisher of this book have used their best efforts in preparing the book and the programs contained in it. These efforts include the development, research, and testing of the theories and programs to determine their effectiveness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these programs or the documentation contained in this book.
This is a short excerpt from the opening of “” by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.
Book Information
- Unique ID: af35592c5e65adba
- File Extension: .pdf
- File Size: 56,979,181 bytes (54.34 MB)
- Title: –
- Author: Unknown
- ISBN: 1588800970
- Pages: 1197
- Language: English (en)
Reading & Word Statistics
- Estimated Reading Time: 1395.94 minutes
- Total Words: 279,188
- Total Characters: 1,850,695
- Average Words per Page: 233.24
- Average Characters per Page: 1546.11
Most Frequent Words
class (3398), java (3235), void (2569), int (2482), string (2207), new (1916), object (1672), public (1427), method (1402), text (1156), gets (1142), applet (1116), add (1069), use (1000), table (948), using (934), chapter (931), awt (909), static (876), value (874), methods (849), code (844), component (826), file (786), here’s (774), item (769), boolean (760), swing (759), button (672), given (658), import (655), data (651), example (649), system (632), creating (623), solutions (606), menu (604), immediate (590), see (585), index (564), name (563), xml (519), list (501), protected (488), thread (481), app (476), sets (452), event (450), printin (449), dialog (448), figure (443), main (438), one (432), create (428), user (424), classes (421), says (419), look (417), array (417), returns (386), like (385), window (383), set (380), buttons (377), image (367), interface (360), true (355), also (347), say (343), box (341), display (341), extends (341), lang (336), number (332), loop (329), components (325), container (325), hello (322), type (322), label (320), constructs (319), you’ll (316), result (313), args (313), document (309), now (308), graphics (307), icon (306), pane (298), want (295), frame (293), element (291), next (290), handling (289), fields (289), current (289), color (287), start (285), continued (283), panes (282).
