本文整理匯總了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);
}