SunSPOT API V3.0


com.sun.spot.io.j2me.socket
Class SocketProtocolOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.sun.spot.io.j2me.socket.SocketProtocolOutputStream

public class SocketProtocolOutputStream
extends OutputStream

Socket specific InputSteam. This class handles the passing of protocol information while remaining seamless to the user.

Author:
Martin Morissette

Field Summary
static int CONNECTION_CLOSE
           
static int END_OF_MSG
           
static int ESCAPE_CHAR
           
static int IOEXCEPTION
           
 
Constructor Summary
SocketProtocolOutputStream(OutputStream out)
          Create the output stream from another OutputStream.
 
Method Summary
 void close()
          Close the OutputStream
 void flush()
          Flush the stream.
 void write(int data)
          Write data in the stream.
 void writeError(String message)
          Write an error to the stream.
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESCAPE_CHAR

public static final int ESCAPE_CHAR
See Also:
Constant Field Values

CONNECTION_CLOSE

public static final int CONNECTION_CLOSE
See Also:
Constant Field Values

IOEXCEPTION

public static final int IOEXCEPTION
See Also:
Constant Field Values

END_OF_MSG

public static final int END_OF_MSG
See Also:
Constant Field Values
Constructor Detail

SocketProtocolOutputStream

public SocketProtocolOutputStream(OutputStream out)
Create the output stream from another OutputStream.

Parameters:
out - OutputStream to be used
Method Detail

write

public void write(int data)
           throws IOException
Write data in the stream.

Specified by:
write in class OutputStream
Parameters:
data - the byte.
Throws:
IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.

writeError

public void writeError(String message)
                throws IOException
Write an error to the stream.

Throws:
IOException

flush

public void flush()
           throws IOException
Flush the stream. All buffered data will be sent.

Overrides:
flush in class OutputStream
Throws:
IOException - if an I/O error occurs.

close

public void close()
           throws IOException
Close the OutputStream

Overrides:
close in class OutputStream
Throws:
IOException - if an I/O error occurs.

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.