DCT Lightfoot v3 API specification

com.dctl.j2me.io
Class HandleOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--com.dctl.j2me.io.HandleOutputStream
All Implemented Interfaces:
Lockable, Writable

public class HandleOutputStream
extends OutputStream
implements Lockable

Output stream that can use a C handle for outputing information


Constructor Summary
HandleOutputStream(int handle)
          Create a new handle output stream with a handle
 
Method Summary
 void close()
          Close the stream
 void flush()
          Flush the stream
static int getSTDERRHandle()
          Get the handle for stderr
static int getSTDOUTHandle()
          Get the handle for stdout
 void lock()
          Lock the stream.
 void unlock()
          Unlock the stream.
 void write(byte[] buffer)
          Write an array of bytes
 void write(byte[] buffer, int offset, int length)
          Write an array of bytes starting at an offset and continuing for length
 void write(int b)
          Write one byte
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandleOutputStream

public HandleOutputStream(int handle)
Create a new handle output stream with a handle

Parameters:
handle - The handle to use
Method Detail

getSTDOUTHandle

public static int getSTDOUTHandle()
Get the handle for stdout

Returns:
the stdout handle

getSTDERRHandle

public static int getSTDERRHandle()
Get the handle for stderr

Returns:
the stderr handle

lock

public void lock()
Lock the stream. This blocks until the lock is complete

Specified by:
lock in interface Lockable

unlock

public void unlock()
Unlock the stream. This unlocks the stream

Specified by:
unlock in interface Lockable

close

public void close()
           throws IOException
Close the stream

Overrides:
close in class OutputStream
Throws:
IOException - if there is an error

flush

public void flush()
           throws IOException
Flush the stream

Overrides:
flush in class OutputStream
Throws:
IOException - if there is an error

write

public void write(byte[] buffer)
           throws IOException
Write an array of bytes

Overrides:
write in class OutputStream
Parameters:
buffer - The buffer to write
Throws:
IOException - if there is an error

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws IOException
Write an array of bytes starting at an offset and continuing for length

Specified by:
write in interface Writable
Overrides:
write in class OutputStream
Parameters:
buffer - The buffer to write
offset - The offset to start writing
length - The length to write for
Throws:
IOException - if there is an error

write

public void write(int b)
           throws IOException
Write one byte

Specified by:
write in interface Writable
Specified by:
write in class OutputStream
Parameters:
b - The byte to write
Throws:
IOException - if there is an error

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification