本文整理汇总了Java中org.tukaani.xz.UnsupportedOptionsException类的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedOptionsException类的具体用法?Java UnsupportedOptionsException怎么用?Java UnsupportedOptionsException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnsupportedOptionsException类属于org.tukaani.xz包,在下文中一共展示了UnsupportedOptionsException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getInstance
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
public static Check getInstance(int checkType)
throws UnsupportedOptionsException {
switch (checkType) {
case XZ.CHECK_NONE:
return new None();
case XZ.CHECK_CRC32:
return new CRC32();
case XZ.CHECK_CRC64:
return new CRC64();
case XZ.CHECK_SHA256:
try {
return new SHA256();
} catch (java.security.NoSuchAlgorithmException e) {}
break;
}
throw new UnsupportedOptionsException(
"Unsupported Check ID " + checkType);
}
开发者ID:dbrant,项目名称:zimdroid,代码行数:24,代码来源:Check.java
示例2: decodeStreamHeader
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
public static StreamFlags decodeStreamHeader(byte[] buf)
throws IOException {
for (int i = 0; i < XZ.HEADER_MAGIC.length; ++i)
if (buf[i] != XZ.HEADER_MAGIC[i])
throw new XZFormatException();
if (!isCRC32Valid(buf, XZ.HEADER_MAGIC.length, 2,
XZ.HEADER_MAGIC.length + 2))
throw new CorruptedInputException("XZ Stream Header is corrupt");
try {
return decodeStreamFlags(buf, XZ.HEADER_MAGIC.length);
} catch (UnsupportedOptionsException e) {
throw new UnsupportedOptionsException(
"Unsupported options in XZ Stream Header");
}
}
开发者ID:dbrant,项目名称:zimdroid,代码行数:18,代码来源:DecoderUtil.java
示例3: delete
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
@Override // ClientProtocol
public boolean delete(String src, boolean recursive) throws IOException {
if (stateChangeLog.isDebugEnabled()) {
stateChangeLog.debug(
"*DIR* Namenode.delete: src=" + src + ", recursive=" + recursive);
}
boolean ret;
if (namesystem.isLegacyDeleteEnabled()) {
//ret = namesystem.incrementalDelete(src, recursive);
throw new UnsupportedOptionsException("Old single transaction delete "
+ "is not supported ");
} else {
ret = namesystem.multiTransactionalDelete(src, recursive);
}
if (ret) {
metrics.incrDeleteFileOps();
}
return ret;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:22,代码来源:NameNodeRpcServer.java
示例4: getInstance
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
public static Check getInstance(int checkType)
throws UnsupportedOptionsException {
switch (checkType) {
case XZ.CHECK_NONE:
return new None();
case XZ.CHECK_CRC32:
return new CRC32();
case XZ.CHECK_CRC64:
return new CRC64();
case XZ.CHECK_SHA256:
try {
return new SHA256();
} catch (java.security.NoSuchAlgorithmException e) {
}
break;
}
throw new UnsupportedOptionsException("Unsupported Check ID "
+ checkType);
}
开发者ID:anadon,项目名称:JLS,代码行数:25,代码来源:Check.java
示例5: decodeStreamHeader
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
public static StreamFlags decodeStreamHeader(byte[] buf) throws IOException {
for (int i = 0; i < XZ.HEADER_MAGIC.length; ++i)
if (buf[i] != XZ.HEADER_MAGIC[i])
throw new XZFormatException();
if (!isCRC32Valid(buf, XZ.HEADER_MAGIC.length, 2,
XZ.HEADER_MAGIC.length + 2))
throw new CorruptedInputException("XZ Stream Header is corrupt");
try {
return decodeStreamFlags(buf, XZ.HEADER_MAGIC.length);
} catch (UnsupportedOptionsException e) {
throw new UnsupportedOptionsException(
"Unsupported options in XZ Stream Header");
}
}
开发者ID:anadon,项目名称:JLS,代码行数:17,代码来源:DecoderUtil.java
示例6: decodeStreamFooter
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
public static StreamFlags decodeStreamFooter(byte[] buf) throws IOException {
if (buf[10] != XZ.FOOTER_MAGIC[0] || buf[11] != XZ.FOOTER_MAGIC[1]) {
// NOTE: The exception could be XZFormatException too.
// It depends on the situation which one is better.
throw new CorruptedInputException("XZ Stream Footer is corrupt");
}
if (!isCRC32Valid(buf, 4, 6, 0))
throw new CorruptedInputException("XZ Stream Footer is corrupt");
StreamFlags streamFlags;
try {
streamFlags = decodeStreamFlags(buf, 8);
} catch (UnsupportedOptionsException e) {
throw new UnsupportedOptionsException(
"Unsupported options in XZ Stream Footer");
}
streamFlags.backwardSize = 0;
for (int i = 0; i < 4; ++i)
streamFlags.backwardSize |= (buf[i + 4] & 0xFF) << (i * 8);
streamFlags.backwardSize = (streamFlags.backwardSize + 1) * 4;
return streamFlags;
}
开发者ID:anadon,项目名称:JLS,代码行数:27,代码来源:DecoderUtil.java
示例7: decodeStreamFooter
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
public static StreamFlags decodeStreamFooter(byte[] buf)
throws IOException {
if (buf[10] != XZ.FOOTER_MAGIC[0] || buf[11] != XZ.FOOTER_MAGIC[1]) {
// NOTE: The exception could be XZFormatException too.
// It depends on the situation which one is better.
throw new CorruptedInputException("XZ Stream Footer is corrupt");
}
if (!isCRC32Valid(buf, 4, 6, 0))
throw new CorruptedInputException("XZ Stream Footer is corrupt");
StreamFlags streamFlags;
try {
streamFlags = decodeStreamFlags(buf, 8);
} catch (UnsupportedOptionsException e) {
throw new UnsupportedOptionsException(
"Unsupported options in XZ Stream Footer");
}
streamFlags.backwardSize = 0;
for (int i = 0; i < 4; ++i)
streamFlags.backwardSize |= (buf[i + 4] & 0xFF) << (i * 8);
streamFlags.backwardSize = (streamFlags.backwardSize + 1) * 4;
return streamFlags;
}
开发者ID:dbrant,项目名称:zimdroid,代码行数:28,代码来源:DecoderUtil.java
示例8: decodeStreamFlags
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
private static StreamFlags decodeStreamFlags(byte[] buf, int off)
throws UnsupportedOptionsException {
if (buf[off] != 0x00 || (buf[off + 1] & 0xFF) >= 0x10)
throw new UnsupportedOptionsException();
StreamFlags streamFlags = new StreamFlags();
streamFlags.checkType = buf[off + 1];
return streamFlags;
}
开发者ID:dbrant,项目名称:zimdroid,代码行数:11,代码来源:DecoderUtil.java
示例9: decodeStreamFlags
import org.tukaani.xz.UnsupportedOptionsException; //导入依赖的package包/类
private static StreamFlags decodeStreamFlags(byte[] buf, int off)
throws UnsupportedOptionsException {
if (buf[off] != 0x00 || (buf[off + 1] & 0xFF) >= 0x10)
throw new UnsupportedOptionsException();
StreamFlags streamFlags = new StreamFlags();
streamFlags.checkType = buf[off + 1];
return streamFlags;
}
开发者ID:anadon,项目名称:JLS,代码行数:11,代码来源:DecoderUtil.java
注:本文中的org.tukaani.xz.UnsupportedOptionsException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论