Package com.gengoai.io.resource
Class WriterResource
- java.lang.Object
-
- com.gengoai.io.resource.BaseResource
-
- com.gengoai.io.resource.WriterResource
-
- All Implemented Interfaces:
NonTraversableResource
,Resource
,WriteOnlyResource
,Serializable
public class WriterResource extends BaseResource implements WriteOnlyResource, NonTraversableResource
The type Writer resource.- 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 WriterResource(Writer writer)
Instantiates a new Writer 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.boolean
exists()
Exists boolean.Writer
writer()
Opens a writer for writing for writing to the resource-
Methods inherited from class com.gengoai.io.resource.BaseResource
asFile, asURI, baseName, canRead, canWrite, compressed, createInputStream, createOutputStream, 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
-
Methods inherited from interface com.gengoai.io.resource.WriteOnlyResource
canRead, canWrite, lines
-
-
-
-
Constructor Detail
-
WriterResource
public WriterResource(Writer writer)
Instantiates a new Writer resource.- Parameters:
writer
- the writer
-
-
Method Detail
-
writer
public Writer writer() throws IOException
Description copied from interface:Resource
Opens a writer for writing for writing to the resource- Specified by:
writer
in interfaceResource
- Returns:
- A writer
- 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
-
-