当前位置: 首页>>代码示例>>Java>>正文


Java BinaryInputArchive.maxBuffer方法代码示例

本文整理汇总了Java中org.apache.jute.BinaryInputArchive.maxBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java BinaryInputArchive.maxBuffer方法的具体用法?Java BinaryInputArchive.maxBuffer怎么用?Java BinaryInputArchive.maxBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jute.BinaryInputArchive的用法示例。


在下文中一共展示了BinaryInputArchive.maxBuffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readLength

import org.apache.jute.BinaryInputArchive; //导入方法依赖的package包/类
/** Reads the first 4 bytes of lenBuffer, which could be true length or
 *  four letter word.
 *
 * @param k selection key
 * @return true if length read, otw false (wasn't really the length)
 * @throws IOException if buffer size exceeds maxBuffer size
 */
private boolean readLength(SelectionKey k) throws IOException {
    // Read the length, now get the buffer
    int len = lenBuffer.getInt();
    if (!initialized && checkFourLetterWord(sk, len)) {
        return false;
    }
    if (len < 0 || len > BinaryInputArchive.maxBuffer) {
        throw new IOException("Len error " + len);
    }
    if (zkServer == null) {
        throw new IOException("ZooKeeperServer not running");
    }
    incomingBuffer = ByteBuffer.allocate(len);
    return true;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:23,代码来源:NIOServerCnxn.java

示例2: readLength

import org.apache.jute.BinaryInputArchive; //导入方法依赖的package包/类
/** Reads the first 4 bytes of lenBuffer, which could be true length or
 *  four letter word.
 *
 * @param k selection key
 * @return true if length read, otw false (wasn't really the length)
 * @throws IOException if buffer size exceeds maxBuffer size
 */
private boolean readLength(SelectionKey k) throws IOException {
    // Read the length, now get the buffer
    int len = lenBuffer.getInt();
    if (!initialized && checkFourLetterWord(sk, len)) {
        return false;
    }
    if (len < 0 || len > BinaryInputArchive.maxBuffer) {
        throw new IOException("Len error " + len);
    }
    if (!isZKServerRunning()) {
        throw new IOException("ZooKeeperServer not running");
    }
    incomingBuffer = ByteBuffer.allocate(len);
    return true;
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:23,代码来源:NIOServerCnxn.java


注:本文中的org.apache.jute.BinaryInputArchive.maxBuffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。