- 收藏
- 点赞
- 分享
- 举报
java怎么在已有的dbf文件中追加数据,不是覆盖文件;没有报错但是打开文件后却没有追加的数据
public static void copyDBF(File source, File dest) {
InputStream in = null;
OutputStream out = null;
try {
in = new FileInputStream(source);
out = new FileOutputStream(dest);
byte[] buf = new byte[1024];
int bytesRead;
while ((bytesRead = in.read(buf)) > 0) {
out.write(buf, 0, bytesRead);
}
} catch(Exception e){
e.printStackTrace();
}finally {
try {
in.close();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static void writeDBF(File dest) {
DBFWriter writer;
try {
writer = new DBFWriter(dest);
Object[] rowData = new Object[8];
rowData[0] = “1”;
rowData[1] = “1”;
rowData[2] = null;
rowData[3] = null;
rowData[4] = null;
rowData[5] = null;
rowData[6] = null;
rowData[7] = null;
writer.addRecord(rowData);
OutputStream fos = new FileOutputStream(dest);
writer.write(fos);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
File source = new File(“D:/java/ZJRMYEK.DBF”);
File dest = new File(“D:/java/aaa.DBF”);
writeDBF.copyDBF(source,dest);
writeDBF.writeDBF(dest);
}
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
-
2020-10-12 16:35:23
-
2018-09-10 15:33:20
-
2019-01-04 13:36:51
-
142017-04-26 11:32:15
-
2018-12-11 10:01:38
-
2018-12-06 09:09:40
-
2018-12-14 15:33:18
-
2020-11-21 15:57:20
-
2020-01-06 10:45:05
-
2020-01-07 21:43:44
-
2018-05-29 14:56:07
-
2019-02-21 10:48:10
-
2019-01-30 15:40:36
-
2023-11-20 13:25:05
-
2018-11-02 14:57:41
-
2012-12-04 11:53:25
-
2012-12-24 14:34:51
-
2016-09-22 16:26:31
-
2020-11-21 18:12:30
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明