public class CASAOutputStream extends OutputStream
Note that a CASAOutputStream is not allowed to write to any reserved nodes.
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Field and Description |
---|---|
private int[] |
buffer |
private static int |
BUFFER_LENGTH |
private int |
bufferIndex |
private FilePosition |
initialPosition |
private FilePosition |
lastWrite |
private String |
node |
private boolean |
validStream |
Modifier | Constructor and Description |
---|---|
protected |
CASAOutputStream(FilePosition pos,
int writeMode)
protected constructors - allows writing to reserved nodes
assumes parameters etc are valid
|
|
CASAOutputStream(String nodeName) |
|
CASAOutputStream(String nodeName,
int writeMode,
CASAFile file) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the stream.
|
void |
flush()
Flush the internal buffer to the file.
|
void |
write(int b)
Writes the specified byte to this output stream.
|
write, write
private static int BUFFER_LENGTH
private int[] buffer
private int bufferIndex
private String node
private FilePosition lastWrite
private FilePosition initialPosition
private boolean validStream
public CASAOutputStream(String nodeName) throws CASAIOException, IOException
CASAIOException
IOException
public CASAOutputStream(String nodeName, int writeMode, CASAFile file) throws CASAIOException, IOException
CASAIOException
IOException
protected CASAOutputStream(FilePosition pos, int writeMode) throws CASAIOException, IOException
CASAIOException
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException