Packages
 In this topic

*Example

*Classes

*Hierarchy

 

Packages   PackagesNext
Package com.ms.io   Packages Next

 


About com.ms.io

The 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:
Class Basic Functionality
IntArrayOutputStream An output stream for primitive integers.
SystemInputStream An input stream that can be handed to untrusted code.
SystemOutputStream An output stream that can be handed to untrusted code.
OffsetInputStreamFilter A filter input stream that keeps track of the byte offset into the stream.

Example

The 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

Class IntArrayOutputStream
This class provides methods that create and manipulate output streams for primitive integers.
Class ObjectInputStreamWithLoader
This class provides methods that allow a class to be resolved by using an existing ClassLoader instance instead of the system class loader.
Class OffsetInputStreamFilter
This class represents a filter input stream that keeps track of the byte offset into the stream.
Class Path
This class provides methods for checking and manipulating strings that represent paths.
Class SystemInputStream
This class provides methods that allow an application to hand an input stream to untrusted code and prevent the untrusted code from closing it.
Class SystemOutputStream
This class provides methods that allow an application to hand an output stream to untrusted code and prevent the untrusted code from closing it.
Class UserFileDialog
This class provides methods for creating and displaying dialog boxes that can open files for reading, writing, and random access.

Hierarchy

Object
  |
  +--Path
  |
  +--UserFileDialog

OutputStream
  |
  +--IntArrayOutputStream (Cloneable)

ObjectInputStream
  |
  +--ObjectInputStreamWithLoader

FilterInputStream
  |
  +--OffsetInputStreamFilter
  |
  +--SystemInputStream

FilterOutputStream
  |
  +--SystemOutputStream

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.