org.erights.e.elib.eio
Class EIO

java.lang.Object
  |
  +--org.erights.e.elib.eio.EIO

public class EIO
extends Object

Safe: Start Here: Safe static methods, typically for making EIO objects of various kinds.

Author:
Mark S. Miller
See Also:
The EIO pages

Field Summary
static int ALL
          Enabled: ALL (Integer.MAX_VALUE) represents the number of remaining elements left until termination (close or fail) will be hit.
static StaticMaker EIOMaker
          Enabled:
 
Constructor Summary
private EIO()
          prevents instantiation
 
Method Summary
static Object[] makeBytesWriter(int sizeHint)
          Enabled: Like makeListWriter(int, Class), but with elementType 'byte'.
static Object[] makeListWriter(int sizeHint, Class elementType)
          Enabled: Makes and returns a pair of an OutStream and a promise for the list of all the elements written to that writer.
static Object[] makeStringWriter(int sizeHint)
          Enabled: Like makeListWriter(int, Class), but the elementType is 'char', and on success the promise resolves to a bare Twine of these characters.
static InStream wrapJInputStream(InputStream jIns)
          Enabled: Wraps a Java InputStream with an InStream of bytes.
static OutStream wrapJOutputStream(OutputStream jOuts)
          Enabled: Wraps a Java OutputStream with an OutStream of bytes.
static OutStream wrapJWriter(Writer jOuts)
          Enabled: Wraps a Java Writer of Strings with a OutStream of chars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EIOMaker

public static final StaticMaker EIOMaker
Enabled:


ALL

public static final int ALL
Enabled: ALL (Integer.MAX_VALUE) represents the number of remaining elements left until termination (close or fail) will be hit.

Constructor Detail

EIO

private EIO()
prevents instantiation

Method Detail

makeListWriter

public static Object[] makeListWriter(int sizeHint,
                                      Class elementType)
Enabled: Makes and returns a pair of an OutStream and a promise for the list of all the elements written to that writer.

Should the OutStream be closed, the promise resolves to the list of all the element that have been written.

Should the OutStream fail, the promise will break with the same terminal problem (resolve to a reference broken by that problem).

Parameters:
sizeHint -
elementType -
Returns:

makeStringWriter

public static Object[] makeStringWriter(int sizeHint)
Enabled: Like makeListWriter(int, Class), but the elementType is 'char', and on success the promise resolves to a bare Twine of these characters.


makeBytesWriter

public static Object[] makeBytesWriter(int sizeHint)
Enabled: Like makeListWriter(int, Class), but with elementType 'byte'.

Parameters:
sizeHint -
Returns:

wrapJInputStream

public static InStream wrapJInputStream(InputStream jIns)
Enabled: Wraps a Java InputStream with an InStream of bytes.

Parameters:
jIns -
Returns:

wrapJWriter

public static OutStream wrapJWriter(Writer jOuts)
Enabled: Wraps a Java Writer of Strings with a OutStream of chars.

Parameters:
jOuts -
Returns:

wrapJOutputStream

public static OutStream wrapJOutputStream(OutputStream jOuts)
Enabled: Wraps a Java OutputStream with an OutStream of bytes.

Parameters:
jOuts -
Returns:


comments?