Class FileGeometryOutput
- java.lang.Object
-
- org.apache.commons.geometry.io.core.AbstractGeometryIOMetadata
-
- org.apache.commons.geometry.io.core.output.FileGeometryOutput
-
- All Implemented Interfaces:
GeometryIOMetadata,GeometryOutput
public class FileGeometryOutput extends AbstractGeometryIOMetadata implements GeometryOutput
GeometryOutputimplementation for writing content to a file.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.PathfileFile to write to.
-
Constructor Summary
Constructors Constructor Description FileGeometryOutput(java.nio.file.Path file)Construct a new instance with the given file and no charset.FileGeometryOutput(java.nio.file.Path file, java.nio.charset.Charset charset)Construct a new instance with the given file and charset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.file.PathgetFile()Get the output file.java.io.OutputStreamgetOutputStream()Get the output stream for writing to the output.java.lang.StringtoString()-
Methods inherited from class org.apache.commons.geometry.io.core.AbstractGeometryIOMetadata
getCharset, getFileName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.geometry.io.core.GeometryIOMetadata
getCharset, getFileName
-
-
-
-
Constructor Detail
-
FileGeometryOutput
public FileGeometryOutput(java.nio.file.Path file)
Construct a new instance with the given file and no charset.- Parameters:
file- output file
-
FileGeometryOutput
public FileGeometryOutput(java.nio.file.Path file, java.nio.charset.Charset charset)Construct a new instance with the given file and charset.- Parameters:
file- output filecharset- file charset
-
-
Method Detail
-
getFile
public java.nio.file.Path getFile()
Get the output file.- Returns:
- output file
-
getOutputStream
public java.io.OutputStream getOutputStream()
Get the output stream for writing to the output.The returned output stream is buffered.
- Specified by:
getOutputStreamin interfaceGeometryOutput- Returns:
- output stream for writing to the output
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractGeometryIOMetadata
-
-