|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.shapefile.dbf.DbaseFileWriter
public class DbaseFileWriter
A DbaseFileReader is used to read a dbase III format file. The general use of
this class is:
You must supply the
DbaseFileHeader header = ...
WritableFileChannel out = new FileOutputStream("thefile.dbf").getChannel();
DbaseFileWriter w = new DbaseFileWriter(header,out);
while ( moreRecords ) {
w.write( getMyRecord() );
}
w.close();
moreRecords
and
getMyRecord()
logic...
Nested Class Summary | |
---|---|
static class |
DbaseFileWriter.FieldFormatter
Utility for formatting Dbase fields. |
Constructor Summary | |
---|---|
DbaseFileWriter(DbaseFileHeader header,
java.nio.channels.WritableByteChannel out)
Create a DbaseFileWriter using the specified header and writing to the given channel. |
|
DbaseFileWriter(DbaseFileHeader header,
java.nio.channels.WritableByteChannel out,
java.nio.charset.Charset charset)
Create a DbaseFileWriter using the specified header and writing to the given channel. |
Method Summary | |
---|---|
void |
close()
Release resources associated with this writer. |
void |
write(java.lang.Object[] record)
Write a single dbase record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DbaseFileWriter(DbaseFileHeader header, java.nio.channels.WritableByteChannel out) throws java.io.IOException
header
- The DbaseFileHeader to write.out
- The Channel to write to.
java.io.IOException
- If errors occur while initializing.public DbaseFileWriter(DbaseFileHeader header, java.nio.channels.WritableByteChannel out, java.nio.charset.Charset charset) throws java.io.IOException
header
- The DbaseFileHeader to write.out
- The Channel to write to.charset
- The charset the dbf is (will be) encoded in
java.io.IOException
- If errors occur while initializing.Method Detail |
---|
public void write(java.lang.Object[] record) throws java.io.IOException, DbaseFileException
record
- The entries to write.
java.io.IOException
- If IO error occurs.
DbaseFileException
- If the entry doesn't comply to the header.public void close() throws java.io.IOException
java.io.IOException
- If errors occur.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |