|
|
|||||||||||
About com.ms.ioThe com.ms.io package contains a variety of classes that provide access to specialized input and output operations. You can use the classes in the com.ms.io package to manipulate path strings (Path), create file dialog boxes (UserFileDialog), resolve a class with a non-system class loader (ObjectInputStreamWithLoader), and read and write from specialized input streams. The following table lists the classes in com.ms.io that represent input and output streams:
ExampleThe following code sample opens a file using a file dialog box and then writes an array of bytes to the file. import com.ms.io.UserFileDialog; import java.io.FileOutputStream; import java.awt.Frame; public class MySample { // parent represents the container of the dialog box public void dbOpen(Frame parent, byte[] buffer){ UserFileDialog db = new UserFileDialog(parent,"Open a File"); FileOutputStream stream = db.openFileForWriting(); try{ stream.write(buffer); } catch(IOException e) { System.out.println("I/O error occurred."); } } } Classes
HierarchyObject | +--Path | +--UserFileDialog OutputStream | +--IntArrayOutputStream (Cloneable) ObjectInputStream | +--ObjectInputStreamWithLoader FilterInputStream | +--OffsetInputStreamFilter | +--SystemInputStream FilterOutputStream | +--SystemOutputStream
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |