Name

DataOutputStream

Synopsis

This is a subclass of OutputStream that implements the methods of the DataOutput interface, writing encoded data as a sequence of bytes to another OutputStream. Instances of this class can be created directly. In addition, they can also be obtained from various other sources, such as the openDataOutputStream method of the javax.microedition.io.Connector. This example returns a stream to write data to a network connection or some other type of data source accessed using the CLDC Generic Connection Framework.

Note that the CLDC version of this class is derived from OutputStream and not FilterOutputStream, as it is in J2SE. This is because the CLDC does not have a FilterOutputStream class.

                  Implementations
public class DataOutputStream extends OutputStream implements DataOutput {  
// Public Constructors
   public DataOutputStream( OutputStream out);  
// Methods Implementing DataOutput
   public void write( int b) throws IOException;  
   public void write(byte[] b, int off, 
        int len) throws IOException;  
   public final void writeBoolean(
        boolean v) throws IOException;  
   public final void writeByte( int v) throws IOException;  
   public final void writeChar( int v) throws IOException;  
   public final void writeChars(String s) throws IOException;  
   public final void writeInt( int v) throws IOException;  
   public final void writeLong( long v) throws IOException;  
   public final void writeShort( int v) throws ...

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.