Interface StreamDataSource
-
- All Superinterfaces:
DataSource
public interface StreamDataSource extends DataSource
A data source with a single input stream. Here it is cosy for us to distance ourselves from file-system and to work with streams of data rather than files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
delete()
boolean
exists()
if rv == false, thenopenInputStream()
will throw IOException so check it before readingString
getStreamName()
InputStream
openInputStream()
Access named stream for reading.OutputStream
openOutputStream()
Access named stream for writing.-
Methods inherited from interface org.jetbrains.mps.openapi.persistence.DataSource
addListener, getLocation, getTimestamp, getType, isAlive, isReadOnly, refresh, removeListener
-
-
-
-
Method Detail
-
openInputStream
@NotNull InputStream openInputStream() throws IOException
Access named stream for reading. Caller is responsible to close the stream once done.- Returns:
- stream to read from, never
null
- Throws:
IOException
- if failed to open given named stream
-
openOutputStream
@NotNull OutputStream openOutputStream() throws IOException
Access named stream for writing. Caller is responsible to close the stream once done.- Returns:
- stream to write to, never
null
- Throws:
IOException
- if failed to open given named stream
-
delete
boolean delete()
- Returns:
- true if success
-
exists
boolean exists()
if rv == false, thenopenInputStream()
will throw IOException so check it before reading
-
-