UserSpace class

The UserSpace class represents a user space on the server. Required parameters are the name of the user space and the AS400 object that represents the server that has the user space. Methods exist in user space class to do the following:

The UserSpace object requires the integrated file system path name of the program. See integrated file system path names for more information.

Using the UserSpace class causes the AS400 object to connect to the server. See managing connections for information about managing connections.

The following example creates a user space, then writes data to it.
Note: Read the Code example disclaimer for important legal information.
                       // Create an AS400 object.
     AS400 sys = new AS400("mySystem.myCompany.com");

                       // Create a user space object.  
     UserSpace US = new UserSpace(sys, 
               "/QSYS.LIB/MYLIB.LIB/MYSPACE.USRSPC");

                       // Use the create method to create the user space on
                       // the server.              
     US.create(10240,                           // The initial size is 10KB
               true,                            // Replace if the user space already exists
               " ",                             // No extended attribute
               (byte) 0x00,                     // The initial value is a null
               "Created by a Java program",     // The description of the user space
               "*USE");                         // Public has use authority to the user space
                                                  
                       
                       // Use the write method to write bytes to the user space.
     US.write("Write this string to the user space.", 0);