本文整理汇总了Java中org.apache.hadoop.security.SaslInputStream类的典型用法代码示例。如果您正苦于以下问题:Java SaslInputStream类的具体用法?Java SaslInputStream怎么用?Java SaslInputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SaslInputStream类属于org.apache.hadoop.security包,在下文中一共展示了SaslInputStream类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStreamPair
import org.apache.hadoop.security.SaslInputStream; //导入依赖的package包/类
/**
* Return some input/output streams that may henceforth have their
* communication encrypted, depending on the negotiated quality of protection.
*
* @param out output stream to wrap
* @param in input stream to wrap
* @return IOStreamPair wrapping the streams
*/
public IOStreamPair createStreamPair(DataOutputStream out,
DataInputStream in) {
if (saslClient != null) {
return new IOStreamPair(
new SaslInputStream(in, saslClient),
new SaslOutputStream(out, saslClient));
} else {
return new IOStreamPair(
new SaslInputStream(in, saslServer),
new SaslOutputStream(out, saslServer));
}
}
示例2: createEncryptedStreamPair
import org.apache.hadoop.security.SaslInputStream; //导入依赖的package包/类
private IOStreamPair createEncryptedStreamPair(
DataOutputStream out, DataInputStream in) {
if (saslClient != null) {
return new IOStreamPair(
new SaslInputStream(in, saslClient),
new SaslOutputStream(out, saslClient));
} else {
return new IOStreamPair(
new SaslInputStream(in, saslServer),
new SaslOutputStream(out, saslServer));
}
}
示例3: createEncryptedStreamPair
import org.apache.hadoop.security.SaslInputStream; //导入依赖的package包/类
private IOStreamPair createEncryptedStreamPair(DataOutputStream out,
DataInputStream in) {
if (saslClient != null) {
return new IOStreamPair(new SaslInputStream(in, saslClient),
new SaslOutputStream(out, saslClient));
} else {
return new IOStreamPair(new SaslInputStream(in, saslServer),
new SaslOutputStream(out, saslServer));
}
}
示例4: getInputStream
import org.apache.hadoop.security.SaslInputStream; //导入依赖的package包/类
/**
* Get a SASL wrapped InputStream. Can be called only after saslConnect() has
* been called.
*
* @param in
* the InputStream to wrap
* @return a SASL wrapped InputStream
* @throws IOException
*/
public InputStream getInputStream(InputStream in) throws IOException {
if (!saslClient.isComplete()) {
throw new IOException("Sasl authentication exchange hasn't completed yet");
}
return new SaslInputStream(in, saslClient);
}
示例5: getInputStream
import org.apache.hadoop.security.SaslInputStream; //导入依赖的package包/类
/**
* Get a SASL wrapped InputStream. Can be called only after saslConnect() has
* been called.
*
* @param in
* the InputStream to wrap
* @return a SASL wrapped InputStream
* @throws IOException
*/
public InputStream getInputStream(InputStream in) throws IOException {
if (!saslClient.isComplete()) {
throw new IOException("Sasl authentication exchange hasn't completed yet");
}
return new SaslInputStream(in, saslClient);
}