Résumé
Table of contents :
Preface ..... ix
Acknowledgments ..... xv
Part I: How Java Works .....
1
Chapter 1: Introducing Java
SECRETS ..... 3
- A Little Knowledge Can Be a Dangerous Thing .....
4
What's in This Book? ..... 4
Why Java Secrets? ..... 7
Where Did the Secrets Come From? ..... 8
What Versions of Java are Covered? ..... 11
Some Objections ..... 12
Summary ..... 17
Chapter 2: Primitive Data
Types ..... 19
- Bytes in Memory ..... 19
Variables, Values, and Identifiers ..... 21
Place-Value Number Systems ..... 22
Integers ..... 28
Floating-Point Numbers ..... 32
CHAR ..... 38
Boolean ..... 46
Cross-Platform Issues ..... 47
Conversions and Casting ..... 53
Bit-Level Operators ..... 57
Summary ..... 71
Chapter 3: Classes, Strings,
and Arrays ..... 73
- The Heap ..... 73
Pointers, Handles, and References ..... 75
The Class Class ..... 88
The Object Class ..... 93
Arrays ..... 99
Strings ..... 104
java.util Data Structures ..... 111
Summary ..... 125
Chapter 4: The Java Virtual
Machine ..... 127
- Reading Compiled Files ..... 127
Reading Class Files ..... 137
Putting it All Together ..... 165
Legal Issues ..... 180
Accessing Class Files ..... 183
Summary ..... 186
Chapter 5: Java Byte Code
..... 187
- Byte Code Mnemonics ..... 188
Using Mnemonics in the Disassembler ..... 197
Stacks, Frames, and Pools ..... 207
The Opcodes ..... 216
Decompilers and Other Tools ..... 273
Summary ..... 275
Part II: The Sun Classes .....
277
Chapter 6: Threads and Garbage
Collection ..... 279
- Threads ..... 280
Grabage Collection ..... 288
Summary ..... 294
Chapter 7: Controlling Applets
..... 295
- What Is An Applet? ..... 295
Applets Are Components Too ..... 298
Stubs and Context ..... 306
Loading Classes ..... 321
Setting Security Policies ..... 331
Loading Applets from Web Pages ..... 341
Summary ..... 351
Chapter 8: Introducing the Sun
Classes ..... 353
- What the Sun Classes Are ..... 354
Why the Sun Classes Exist ..... 356
Using the Sun Classes Safely ..... 358
Summary ..... 368
Chapter 9: Using the
Sun.Applet Classes to View Applets ..... 369
- The sun.applet Package ..... 370
The AppletViewer Class ..... 371
The AppletPanel and AppletViewerPanel Classes ..... 377
The AppletClassLoader Class ..... 382
The AppletSecurity Class ..... 382
Support Classes ..... 392
Summary ..... 396
Chapter 10: Controlling Audio
Playback with Sun.Audio ..... 399
- AppletAudioClip ..... 400
AudioData ..... 401
AudioPlayer ..... 401
The Audio Streams ..... 402
AudioDevice ..... 408
The Process ..... 410
Putting It All Together ..... 411
Summary ..... 415
Chapter 11: Controlling the
AWT with the Sun.Awt Package ..... 417
- Aligning Objects with the sun.awt LayoutManagers .....
417
FocusingTextField ..... 436
Controlling Screen Updating ..... 440
Summary ..... 443
Chapter 12: Encoding and
Decoding Data with the Sun.Misc Package ..... 445
- Coding Binary Data in ASCII ..... 446
The CharacterEncoder and CharacterDecoder Classes ..... 447
HexDump Encoding ..... 449
Base64 Encoding ..... 451
UUEncoding ..... 455
UCEncoding ..... 460
Creating New Encodings ..... 464
The CRC class ..... 470
Summary ..... 472
Chapter 13: Network Servers
and Clients in the Sun.Net Package ..... 475
- Writing Network Servers ..... 476
Writing Network Clients ..... 483
TransferProtocolClient ..... 487
Summary ..... 491
Chapter 14: Sending Mail with
the Sun.Net.SMTP Package ..... 493
- SmtpClient ..... 493
Choosing an SMTP Server ..... 498
Summary ..... 501
Chapter 15: Reading News via
NNTP with the Sun.Net.NNTP Package ..... 503
- NewsgroupInfo ..... 504
NntpClient ..... 505
Summary ..... 514
Chapter 16: Transferring Files
with the Sun.Net.Ftp Package ..... 515
- Overview of the sun.net.ftp Package ..... 515
The FTP Protocol ..... 516
The FtpClient Class ..... 521
Subclassing FtpClient ..... 526
Summary ..... 530
Chapter 17: Communicating with
Web Servers ..... 531
- Message Formats ..... 531
Tracking Downloads: Metered Streams ..... 552
sun.net.www.URLConnection ..... 554
sun.net.www.http ..... 555
sun.net.www.httpd and the BasicHttpServer ..... 565
Content Handlers ..... 567
Protocol Handlers ..... 572
Summary ..... 595
Part III: Platform-Dependent
Java ..... 597
Chapter 18: Character
Conversion with Sun.Io ..... 599
- Available Conversions ..... 600
Using the Converters ..... 605
Direct Conversions ..... 605
Substitution Mode ..... 609
Summary ..... 619
Chapter 19: Mixed Language
Programming with Native Methods ..... 621
- Disadvantages ..... 623
Code in Java First ..... 626
The Java Native Method Interface ..... 631
Using Objects in Native Methods ..... 642
Determining at Runtime Whether Native Code Is Available ..... 670
Summary ..... 673
Chapter 20: Creating
Stand-Alone Programs ..... 675
- Writing Stand-Alone Programs for UNIX ..... 676
Creating Stand-Alone Programs for the MacOS ..... 684
Creating Stand-Alone Windows Programs ..... 691
Summary ..... 692
Part IV: Appendixes .....
695
Appendix A: Class Defined in
Index ..... 697
Appendix B: Method Defined in
Index ..... 709
Appendix C: Sub-Class Index
..... 761
Appendix D: Interface
Implemented by Index ..... 773
Appendix E: Class Returned by
Index ..... 777
Appendix F: Class Passed to
Index ..... 801
Appendix G: Sun Class
Hierarchy Diagrams ..... 831
Appendix H: About the CD-ROM
..... 847
- What Is Included on the CD-ROM ..... 848
A Word About the Programs ..... 849
Index ..... 853
IDG Books Worldwide, Inc. End-User License Agreement ..... 883
L'auteur - Ed Tittel
Ed Tittel est un vétéran de l'industrie informatique, où il évolue depuis 27 ans. Auteur et consultant, Ed a plus de 130 ouvrages à son actif.
Autres livres de Ed Tittel
Caractéristiques techniques
PAPIER | |
Éditeur(s) | IDG |
Auteur(s) | Ed Tittel |
Collection | Secrets |
Parution | 30/07/1997 |
Nb. de pages | 885 |
EAN13 | 9780764580079 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse