Search in sources :

Example 11 with Direction

use of es.bsc.compss.types.annotations.parameter.Direction in project compss by bsc-wdc.

the class StreamRegistry method newFileOutputStream.

// FileOutputStream
public FileOutputStream newFileOutputStream(File file, boolean append) throws FileNotFoundException {
    Direction direction = (append ? Direction.INOUT : Direction.OUT);
    StreamList list = obtainList(file, direction);
    FileOutputStream fos = new FileOutputStream(list.getRenaming(), append);
    list.addStream(fos);
    try {
        list.addFD(fos.getFD());
    } catch (IOException e) {
        // We must go up as a FileNotFoundException, since it is the one that the application deals with
        throw new FileNotFoundException("Loader - Error creating FileOutputStream for file " + file + lineSep + e.getMessage());
    }
    return fos;
}
Also used : FileOutputStream(java.io.FileOutputStream) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException) Direction(es.bsc.compss.types.annotations.parameter.Direction)

Example 12 with Direction

use of es.bsc.compss.types.annotations.parameter.Direction in project compss by bsc-wdc.

the class StreamRegistry method newFileReader.

// FileReader
public FileReader newFileReader(File file) throws FileNotFoundException {
    Direction direction = Direction.IN;
    StreamList list = obtainList(file, direction);
    FileReader fr = new FileReader(list.getRenaming());
    list.addStream(fr);
    return fr;
}
Also used : FileReader(java.io.FileReader) Direction(es.bsc.compss.types.annotations.parameter.Direction)

Aggregations

Direction (es.bsc.compss.types.annotations.parameter.Direction)12 IOException (java.io.IOException)4 Stream (es.bsc.compss.types.annotations.parameter.Stream)3 FileNotFoundException (java.io.FileNotFoundException)3 PrintStream (java.io.PrintStream)3 DataType (es.bsc.compss.types.annotations.parameter.DataType)2 Type (es.bsc.compss.types.annotations.parameter.Type)2 PrintWriter (java.io.PrintWriter)2 DataLocation (es.bsc.compss.types.data.location.DataLocation)1 BasicTypeParameter (es.bsc.compss.types.parameter.BasicTypeParameter)1 ExternalObjectParameter (es.bsc.compss.types.parameter.ExternalObjectParameter)1 FileParameter (es.bsc.compss.types.parameter.FileParameter)1 ObjectParameter (es.bsc.compss.types.parameter.ObjectParameter)1 Parameter (es.bsc.compss.types.parameter.Parameter)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 FileReader (java.io.FileReader)1 FileWriter (java.io.FileWriter)1 FilterInputStream (java.io.FilterInputStream)1