本文整理汇总了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);
}
}
示例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));
}
}
示例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();
}
示例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));
}
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}
示例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());
}
}
示例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;
}
示例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));
}
}
示例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;
}
示例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();
}
示例14: readKey
import io.github.htools.io.buffer.BufferReaderWriter; //导入方法依赖的package包/类
@Override
public Integer readKey(BufferReaderWriter reader) {
return reader.readInt();
}
示例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();
}