當前位置: 首頁>>代碼示例>>Java>>正文


Java DataOutputStream.writeChars方法代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:26,代碼來源:FontConfiguration.java

示例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;
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:14,代碼來源:TestDelegatingInputFormat.java

示例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);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:15,代碼來源:TestMRCJCFileInputFormat.java


注:本文中的java.io.DataOutputStream.writeChars方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。