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


Java BufferReaderWriter.readInt方法代码示例

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


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

示例1: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
   try {
      int length = in.readInt();
      byte b[] = new byte[length];
      in.readFully(b);
      BufferReaderWriter reader = new BufferReaderWriter(b);
      type = Type.values()[ reader.readByte()];
      partition = reader.readShort();
      feature = reader.readByte();
      termid = reader.readInt();
      collectionid = reader.readString0();
   } catch (EOCException ex) {
      throw new IOException(ex);
   }
}
 
开发者ID:htools,项目名称:htools,代码行数:17,代码来源:RecordKey.java

示例2: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
   BufferReaderWriter reader = new BufferReaderWriter(in);
   hosts = reader.readStringArray();
   partition = readKey(reader);
   int listsize = reader.readInt();
   list = new ArrayList<VALUE>();
   for (int q = 0; q < listsize; q++) {
      list.add(readValue(reader));
   }
}
 
开发者ID:htools,项目名称:htools,代码行数:12,代码来源:MRInputSplit.java

示例3: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
    BufferReaderWriter reader = new BufferReaderWriter(in);
    set(reader.readString0());
    value2 = reader.readString0();
    value3 = reader.readInt();
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:TextTextInt.java

示例4: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
   BufferReaderWriter reader = new BufferReaderWriter(in);
   hosts = reader.readStringArray();
   int listsize = reader.readInt();
   list = new ArrayMap();
   log.info("readFields %s %d", hosts, listsize);
   for (int q = 0; q < listsize; q++) {
      list.add(readKey(reader), readValue(reader));
   }
}
 
开发者ID:htools,项目名称:htools,代码行数:12,代码来源:KVInputSplit.java

示例5: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
    BufferReaderWriter reader = new BufferReaderWriter(in);
    set(reader.readString0());
    value1 = reader.readString0();
    value2 = reader.readInt();
    value3 = reader.readInt();
    isCandidate = reader.readBoolean();
}
 
开发者ID:htools,项目名称:htools,代码行数:10,代码来源:TextTextIntIntBool.java

示例6: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
    BufferReaderWriter reader = new BufferReaderWriter(in);
    set(reader.readString0());
    value2 = reader.readInt();
    value3 = reader.readInt();
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:TextIntIntWritable.java

示例7: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(BufferReaderWriter reader) {
    value = reader.readString0();
    value1 = reader.readLong();
    value2 = reader.readInt();
    value3 = reader.readInt();
    isCandidate = reader.readBoolean();
}
 
开发者ID:htools,项目名称:htools,代码行数:9,代码来源:TextLongIntIntBool.java

示例8: openRead

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void openRead() throws FileIntegrityException {
    try {
        this.remove(bucketindex);
        super.openRead();
        residenttable = new BufferReaderWriter(getDatafile().readFully());
        super.closeRead();
        bucketcapacity = residenttable.readInt();
        hashfile = new StructuredFileCollisionInternal(new Datafile(this.destfile.getSubFile(".hash")));
        hashfile.openRead();
    } catch (EOCException ex) {
        log.fatalexception(ex, "openRead() bucketindex %d residenttable %s", bucketindex, residenttable);
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:15,代码来源:StructuredFileCollision.java

示例9: openRead

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void openRead() {
    try {
        super.openRead();
        residenttable = new BufferReaderWriter(this.getDatafile().readFully());
        super.closeRead();
        tablesize = residenttable.readInt();
        idfile = new StructuredFileByteJumptableInternal(new Datafile(this.destfile.getSubFile(".jumparray")));
        idfile.openRead();
    } catch (EOCException ex) {
        log.fatalexception(ex, "openRead() residenttable %s datafile %s", residenttable, getDatafile());
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:14,代码来源:StructuredFileSortedByteJumptable.java

示例10: find

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public StructuredFileCollisionRecord find(BufferReaderWriter table, StructuredFileCollisionRecord r) {
    Record rr = (Record) r;
    byte needle[] = rr.name.getBytes();
    int match;
    int offset = table.bufferpos;
    //log.info("find() %s offset %d end %d", rr.name, offset, table.end);
    while (table.bufferpos < table.end) {
        try {
            for (match = 0; match < needle.length && table.buffer[table.bufferpos + match] == needle[match]; match++);
            //log.info("match %d", match);
            if (match == needle.length && table.buffer[table.bufferpos + match] == 0) {
                table.skipString0();
                rr.count = table.readInt();
                return rr;
            }
            int bucketindex = ByteTools.string0HashCode(table.buffer, table.bufferpos, table.end) & (this.getBucketCapacity() - 1);
            if (bucketindex > rr.getBucketIndex()) {
                break;
            }
            String s = table.readString0();
            //log.info("%s %s", rr.name, s);
            table.skip(4);
        } catch (EOCException ex) {
            log.exception(ex, "find( %s, %s )", table, r);
        }
    }
    return null;
}
 
开发者ID:htools,项目名称:htools,代码行数:30,代码来源:StructuredFileCollisionTest.java

示例11: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
   int length = in.readInt();
   byte b[] = new byte[length];
   in.readFully(b);
   BufferReaderWriter reader = new BufferReaderWriter(b);
   hosts = reader.readStringArray();
   partition = reader.readInt();
   int listsize = reader.readInt();
   list = new ArrayList<P>();
   for (int q = 0; q < listsize; q++) {
      list.add(readKey(reader));
   }
}
 
开发者ID:repir,项目名称:repir,代码行数:15,代码来源:MRInputSplit.java

示例12: find

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
/**
 * this function is called by the internal {@link #find(Content.StructuredFileCollision.SortableCollisionRecord)
 * }
 * method, which seeks the offset at which the bucketIndex is position.
 * Because this is a collision table, if a matching entry exists, it is
 * always placed after this offset, as close to the offset as allowed, but
 * there can be other entries in between. An implementing function should
 * therefore readValue until the entry is found or a hashcode is
 * encountered that is greater than the search key's hashcode. In the
 * latter case, the entry does not exist and null should be returned.
 * <p/>
 * @param table the resident table to search, with the offset pointing to
 * the
 * @param r the entry containing the term string to search for
 * @return a matching entry, with its id, or null if it doesn't exist.
 */
@Override
public StructuredFileCollisionRecord find(BufferReaderWriter table, StructuredFileCollisionRecord r) {
   Record rr = (Record) r;
   byte needle[] = rr.term.getBytes();
   int match;
   int offset = table.bufferpos;
   while (table.bufferpos < table.end) {
      try {
         for (match = 0; match < needle.length && table.buffer[table.bufferpos + match] == needle[match]; match++);
         if (match == needle.length && table.buffer[table.bufferpos + match] == 0) {
            table.skipString0();
            rr.id = table.readInt();
            return rr;
         }
         int bucketindex = ByteTools.string0HashCode(table.buffer, table.bufferpos, table.end) & (this.getBucketCapacity() - 1);
         if (bucketindex > rr.getBucketIndex()) {
            break;
         }
         table.skipString0();
         table.skip(4);
      } catch (EOCException ex) {
         log.exception(ex, "find( %s, %s )", table, r);
      }
   }
   return null;
}
 
开发者ID:repir,项目名称:repir,代码行数:43,代码来源:VocMem4.java

示例13: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public void readFields(DataInput in) throws IOException {
    BufferReaderWriter reader = new BufferReaderWriter(in);
    set(reader.readString0());
    value2 = reader.readInt();
}
 
开发者ID:htools,项目名称:htools,代码行数:7,代码来源:TextIntWritable.java

示例14: readKey

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public Integer readKey(BufferReaderWriter reader) {
    return reader.readInt();
}
 
开发者ID:htools,项目名称:htools,代码行数:5,代码来源:IntStringInputSplit.java

示例15: readFields

import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
public void readFields(DataInput in) throws IOException {
   BufferReaderWriter reader = new BufferReaderWriter(in);
   strategy = reader.readString();
   query = reader.readInt();
   time = reader.readDouble();
}
 
开发者ID:repir,项目名称:repirproximity,代码行数:7,代码来源:RecordedTime.java


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