本文整理匯總了Java中com.lowagie.text.pdf.BaseFont.getResourceStream方法的典型用法代碼示例。如果您正苦於以下問題:Java BaseFont.getResourceStream方法的具體用法?Java BaseFont.getResourceStream怎麽用?Java BaseFont.getResourceStream使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.lowagie.text.pdf.BaseFont
的用法示例。
在下文中一共展示了BaseFont.getResourceStream方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getResourceHyphenationTree
import com.lowagie.text.pdf.BaseFont; //導入方法依賴的package包/類
/**
* @param key
* @return a hyphenation tree
*/
public static HyphenationTree getResourceHyphenationTree(String key) {
try {
InputStream stream = BaseFont.getResourceStream(defaultHyphLocation + key + ".xml");
if (stream == null && key.length() > 2) {
stream = BaseFont.getResourceStream(defaultHyphLocation + key.substring(0, 2) + ".xml");
}
if (stream == null) {
return null;
}
HyphenationTree hTree = new HyphenationTree();
hTree.loadSimplePatterns(stream);
return hTree;
}
catch (Exception e) {
return null;
}
}
示例2: getResourceHyphenationTree
import com.lowagie.text.pdf.BaseFont; //導入方法依賴的package包/類
/**
* @param key
* @return a hyphenation tree
*/
public static HyphenationTree getResourceHyphenationTree(String key) {
try {
InputStream stream = BaseFont.getResourceStream(defaultHyphLocation + key + ".xml");
if (stream == null && key.length() > 2)
stream = BaseFont.getResourceStream(defaultHyphLocation + key.substring(0, 2) + ".xml");
if (stream == null)
return null;
HyphenationTree hTree = new HyphenationTree();
hTree.loadSimplePatterns(stream);
return hTree;
}
catch (Exception e) {
return null;
}
}
示例3: getResourceHyphenationTree
import com.lowagie.text.pdf.BaseFont; //導入方法依賴的package包/類
public static HyphenationTree getResourceHyphenationTree(String key) {
try {
InputStream stream = BaseFont.getResourceStream(defaultHyphLocation + key + ".xml");
if (stream == null && key.length() > 2)
stream = BaseFont.getResourceStream(defaultHyphLocation + key.substring(0, 2) + ".xml");
if (stream == null)
return null;
HyphenationTree hTree = new HyphenationTree();
hTree.loadSimplePatterns(stream);
return hTree;
}
catch (Exception e) {
return null;
}
}