本文整理汇总了Java中java.io.DataOutputStream.writeChars方法的典型用法代码示例。如果您正苦于以下问题:Java DataOutputStream.writeChars方法的具体用法?Java DataOutputStream.writeChars怎么用?Java DataOutputStream.writeChars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.io.DataOutputStream
的用法示例。
在下文中一共展示了DataOutputStream.writeChars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveBinary
import java.io.DataOutputStream; //导入方法依赖的package包/类
public static void saveBinary(OutputStream out) throws IOException {
sanityCheck();
DataOutputStream dataOut = new DataOutputStream(out);
writeShortTable(dataOut, head);
writeShortTable(dataOut, table_scriptIDs);
writeShortTable(dataOut, table_scriptFonts);
writeShortTable(dataOut, table_elcIDs);
writeShortTable(dataOut, table_sequences);
writeShortTable(dataOut, table_fontfileNameIDs);
writeShortTable(dataOut, table_componentFontNameIDs);
writeShortTable(dataOut, table_filenames);
writeShortTable(dataOut, table_awtfontpaths);
writeShortTable(dataOut, table_exclusions);
writeShortTable(dataOut, table_proportionals);
writeShortTable(dataOut, table_scriptFontsMotif);
writeShortTable(dataOut, table_alphabeticSuffix);
writeShortTable(dataOut, table_stringIDs);
//stringTable
dataOut.writeChars(new String(table_stringTable));
out.close();
if (verbose) {
dump();
}
}
示例2: getPath
import java.io.DataOutputStream; //导入方法依赖的package包/类
static Path getPath(final String location, final FileSystem fs)
throws IOException {
Path path = new Path(location);
// create a multi-block file on hdfs
DataOutputStream out = fs.create(path, true, 4096, (short) 2, 512, null);
for (int i = 0; i < 1000; ++i) {
out.writeChars("Hello\n");
}
out.close();
return path;
}
示例3: createInputs
import java.io.DataOutputStream; //导入方法依赖的package包/类
private void createInputs(FileSystem fs, Path inDir, String fileName)
throws IOException, TimeoutException, InterruptedException {
// create a multi-block file on hdfs
Path path = new Path(inDir, fileName);
final short replication = 2;
DataOutputStream out = fs.create(path, true, 4096,
replication, 512, null);
for(int i=0; i < 1000; ++i) {
out.writeChars("Hello\n");
}
out.close();
System.out.println("Wrote file");
DFSTestUtil.waitReplication(fs, path, replication);
}