Package com.gengoai.io.resource
Class OutputStreamResource
- java.lang.Object
-
- com.gengoai.io.resource.BaseResource
-
- com.gengoai.io.resource.OutputStreamResource
-
- All Implemented Interfaces:
NonTraversableResource
,Resource
,WriteOnlyResource
,Serializable
public class OutputStreamResource extends BaseResource implements WriteOnlyResource, NonTraversableResource
Resource that wraps anOutputStream
- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.gengoai.io.resource.Resource
Resource.Deserializer
-
-
Field Summary
-
Fields inherited from interface com.gengoai.io.resource.Resource
ALL_FILE_PATTERN
-
-
Constructor Summary
Constructors Constructor Description OutputStreamResource(OutputStream stream)
Instantiates a new Output stream resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
append(byte[] byteArray)
Appends the given byte array content to the resource.OutputStream
createOutputStream()
Create output stream output stream.boolean
exists()
Exists boolean.-
Methods inherited from class com.gengoai.io.resource.BaseResource
asFile, asURI, baseName, canRead, canWrite, compressed, createInputStream, descriptor, getCharset, inputStream, isCompressed, isDirectory, outputStream, path, setCharset, setCompression, setIsCompressed, toString, uncompressed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.io.resource.NonTraversableResource
childIterator, childIterator, getChild, getChildren, getChildren, getChildren, getChildren, getChildren, getParent
-
Methods inherited from interface com.gengoai.io.resource.Resource
append, asFile, asPath, asURI, asURL, baseName, compressed, copy, delete, delete, deleteOnExit, descriptor, forEach, getCharset, inputStream, isCompressed, isDirectory, mkdir, mkdirs, outputStream, path, readBytes, reader, readLines, readObject, readToString, setCharset, setCompression, setIsCompressed, uncompressed, write, write, writeObject, writer
-
Methods inherited from interface com.gengoai.io.resource.WriteOnlyResource
canRead, canWrite, lines
-
-
-
-
Constructor Detail
-
OutputStreamResource
public OutputStreamResource(OutputStream stream)
Instantiates a new Output stream resource.- Parameters:
stream
- the output stream to wrap
-
-
Method Detail
-
exists
public boolean exists()
Description copied from interface:Resource
Exists boolean.
-
createOutputStream
public OutputStream createOutputStream() throws IOException
Description copied from class:BaseResource
Create output stream output stream.- Overrides:
createOutputStream
in classBaseResource
- Returns:
- the output stream
- Throws:
IOException
- the io exception
-
append
public Resource append(byte[] byteArray) throws IOException
Description copied from interface:Resource
Appends the given byte array content to the resource.
- Specified by:
append
in interfaceResource
- Parameters:
byteArray
- The content to append- Returns:
- the resource
- Throws:
IOException
- the io exception
-
-