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


Java BufferReaderWriter类代码示例

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


BufferReaderWriter类属于io.github.htools.io.buffer包,在下文中一共展示了BufferReaderWriter类的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: fillBuffer

import io.github.htools.io.buffer.BufferReaderWriter; //导入依赖的package包/类
public void fillBuffer(BufferReaderWriter buffer) throws EOCException {
   //log.info("readStringFillBuffer");
   if (!buffer.hasMore()) {
      log.fatal("Trying to read past Ceiling (offset %d pos %d end %d ceiling %d)", buffer.offset, buffer.bufferpos, buffer.end, buffer.ceiling);
   }
   int newread, maxread = buffer.readSpace();
   int read = readBytes(buffer.offset + buffer.end, buffer.buffer, buffer.end, maxread);
   //log.info("readStringFillBuffer() %s bufferoffset %d bufferpos %d bufferend %d ceiling %d maxread %d read %d",
   //        this.getFullPathName(), buffer.offset, buffer.bufferpos, buffer.end, buffer.ceiling, maxread, read);
   if (read > 0) {
      buffer.setEnd(buffer.end + read);
   } else {
      buffer.hasmore = false;
      //log.info("EOF reached");
      throw new EOCException();
   }
}
 
开发者ID:htools,项目名称:htools,代码行数:18,代码来源:FSFileInBuffer.java

示例3: fillBuffer

import io.github.htools.io.buffer.BufferReaderWriter; //导入依赖的package包/类
@Override
public void fillBuffer(BufferReaderWriter buffer) throws EOCException {
    //log.info("readStringFillBuffer");
    if (!buffer.hasMore()) {
        log.fatal("Trying to read past Ceiling (offset %d pos %d end %d ceiling %d)", buffer.offset, buffer.bufferpos, buffer.end, buffer.ceiling);
    }

    int newread, maxread = buffer.readSpace();
    int read = readBytes(buffer.offset + buffer.end, buffer.buffer, buffer.end, maxread);
    //log.info("fillBuffer off %d end %d maxread %d read %d", buffer.offset, buffer.end, maxread, read);
    if (read > 0) {
        buffer.setEnd(buffer.end + read);
    } else {
        buffer.hasmore = false;
        //log.info("EOF reached");
        throw new EOCException();
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:19,代码来源:ISDataIn.java

示例4: flushBuffer

import io.github.htools.io.buffer.BufferReaderWriter; //导入依赖的package包/类
@Override
public void flushBuffer(BufferReaderWriter buffer) {
    try {
        if (buffer.buffer != null) {
            //log.info("flushBuffer %d %d", buffer.getOffset() - buffer.bufferpos, buffer.getOffset());

            fsout.write(buffer.buffer, 0, buffer.bufferpos);
            buffer.offset += buffer.bufferpos;
            buffer.bufferpos = 0;
            if (buffer.getRequestedBufferSize() != buffer.getBufferSize()) {
                buffer.resize(buffer.getRequestedBufferSize());
            }
        }
    } catch (IOException ex) {
        log.fatal(ex);
    }
}
 
开发者ID:htools,项目名称:htools,代码行数:18,代码来源:HDFSOut.java

示例5: decode

import io.github.htools.io.buffer.BufferReaderWriter; //导入依赖的package包/类
@Override
public void decode(Document d, int reportid) {
   try {
      ArrayList<Occurrence> list = new ArrayList<Occurrence>();
      BufferReaderWriter reader = new BufferReaderWriter((byte[]) d.reportdata[reportid]);
      int size = reader.readCInt();
      for (int i = 0; i < size; i++) {
         Occurrence o = new Occurrence();
         o.phrase = reader.readString();
         o.span = reader.readCInt();
         o.pos = reader.readCInt();
         list.add(o);
      }
      d.reportdata[reportid] = list;
      //log.info("decode doc %d reportid %d occ %d ist %d", d.docid, reportid, size, ((ArrayList<Occurrence>)d.reportdata[reportid]).size());
   } catch (EOCException ex) {
      log.fatalexception(ex, "valueReported(%s)", d);
   }
}
 
开发者ID:repir,项目名称:repirproximity,代码行数:20,代码来源:AnalyzeDistanceFeature.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());
    value1 = reader.readLong();
    value2 = reader.readLong();
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:TextLongLong.java

示例7: 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

示例8: 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

示例9: readFields

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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: fillBuffer

import io.github.htools.io.buffer.BufferReaderWriter; //导入依赖的package包/类
public void fillBuffer(BufferReaderWriter buffer) {
    int read = readBytes(super.pos, buffer.buffer, buffer.end, buffer.buffer.length - buffer.end);
    if (read == 0)
        throw new EOCException();
    else
        buffer.end += read;
}
 
开发者ID:htools,项目名称:htools,代码行数:8,代码来源:BytesIn.java

示例15: flushBuffer

import io.github.htools.io.buffer.BufferReaderWriter; //导入依赖的package包/类
public void flushBuffer(BufferReaderWriter buffer) {
   //log.info("flushBuffer() %s %s offset %d length %d", outputstream, this.getFullPathName(), buffer.offset, buffer.bufferpos);
   try {
      outputstream.write(buffer.buffer, 0, buffer.bufferpos);
      buffer.offset += buffer.bufferpos;
      buffer.bufferpos = 0;
   } catch (IOException ex) {
      log.exception(ex, "flushBuffer( %s ) outputstream %s", buffer, outputstream);
   }
}
 
开发者ID:htools,项目名称:htools,代码行数:11,代码来源:FSFileOutBuffer.java


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