java.io.DataInputStream.skip()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(319)

本文整理了Java中java.io.DataInputStream.skip()方法的一些代码示例,展示了DataInputStream.skip()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataInputStream.skip()方法的具体详情如下:
包路径:java.io.DataInputStream
类名称:DataInputStream
方法名:skip

DataInputStream.skip介绍

暂无

代码示例

代码示例来源:origin: netty/netty

@Override
public long skip(long n) throws IOException {
  return in.skip(n);
}

代码示例来源:origin: redisson/redisson

@Override
public long skip(long n) throws IOException {
  return in.skip(n);
}

代码示例来源:origin: wildfly/wildfly

@Override
public long skip(long n) throws IOException {
  return in.skip(n);
}

代码示例来源:origin: cmusphinx/sphinx4

/**
 * Reliable skip
 * 
 * @param stream stream
 * @param bytes number of bytes
 */
private void skipStreamBytes(DataInputStream stream, long bytes) throws IOException {
  while (bytes > 0) {
    long skipped = stream.skip(bytes);
    bytesRead += skipped;
    bytes -= skipped;
  }
}

代码示例来源:origin: io.netty/netty

@Override
public long skip(long n) throws IOException {
  return in.skip(n);
}

代码示例来源:origin: Rajawali/Rajawali

public final long skip(int n) throws IOException {
  mPosition += n;
  return d.skip(n);
}

代码示例来源:origin: Rajawali/Rajawali

public final long skip(long n) throws IOException {
  mPosition += n;
  return d.skip(n);
}

代码示例来源:origin: Sable/soot

public void skip(int length) {
 try {
  is.skip(length);
 } catch (IOException e) {
  System.exit(1);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

public long skip(long n) throws IOException {
 if (!useWrap) {
  return inStream.skip(n);

代码示例来源:origin: org.apache.hadoop/hadoop-common

@Override
public long skip(long n) throws IOException {
 if (!checkEOF()) {
  long ret = in.skip(Math.min(remain, n));
  remain -= ret;
  return ret;
 }
 return 0;
}

代码示例来源:origin: FudanNLP/fnlp

protected String readString(DataInputStream input,int pos,int[] reads) throws IOException {
  int read=reads[0];
  input.skip(pos-read);
  read=pos;
  output.reset();
  while(true) {
    int c1 = input.read();
    int c2 = input.read();
    read+=2;
    if(c1==0 && c2==0) {
      break;
    } else {
      output.write(c1);
      output.write(c2);
    }
  }
  reads[0]=read;
  return new String(output.toByteArray(),encoding);
}

代码示例来源:origin: Tencent/tinker

DataInputStream diffIn = new DataInputStream(new ByteArrayInputStream(diffBuf, 0, diffSize));
diffIn.skip(8); // skip headerMagic at header offset 0 (length 8 bytes)
long ctrlBlockLen = diffIn.readLong(); // ctrlBlockLen after bzip2 compression at heater offset 8 (length 8 bytes)
long diffBlockLen = diffIn.readLong(); // diffBlockLen after bzip2 compression at header offset 16 (length 8 bytes)

代码示例来源:origin: Tencent/tinker

diffIn.skip(8); // skip headerMagic at header offset 0 (length 8 bytes)
long ctrlBlockLen = diffIn.readLong(); // ctrlBlockLen after bzip2 compression at heater offset 8 (length 8 bytes)
long diffBlockLen = diffIn.readLong(); // diffBlockLen after bzip2 compression at header offset 16 (length 8 bytes)

代码示例来源:origin: apache/flink

@Override
public void open(Configuration parameters) throws Exception {
  super.open(parameters);
  int subtaskIdx = getRuntimeContext().getIndexOfThisSubtask();
  din = new DataInputStream(
    new BufferedInputStream(
      new FileInputStream(allPartitions.get(subtaskIdx))));
  long toSkip = position;
  while (toSkip > 0L) {
    toSkip -= din.skip(toSkip);
  }
}

代码示例来源:origin: apache/geode

dis.skip(entryPosition);

代码示例来源:origin: FudanNLP/fnlp

model.setSample(readString(input,0xd40,reads));
read = reads[0];
input.skip(0x1540 - read);
read=0x1540;
input.readFully(bytes);
  int mark = readUnsignedShort(input);
  int size = input.readUnsignedByte();
  input.skip(1);
  read += 4;
  assert (size > 0 && (size % 2) == 0);
  input.skip(0x2628 - read);
} else if (flag1 == 0x45) {
  input.skip(0x26C4 - read);
} else {
  throw new RuntimeException("出现意外,联系作者");
    String word = new String(bytes, 0, count, encoding);
    input.skip(12);
    list.add(word);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

dis.skip(idLength);

代码示例来源:origin: Netflix/hollow

public static void discardOrdinals(DataInputStream dis) throws IOException {
  long numLongs = dis.readInt();
  long bytesToSkip = numLongs * 8;
  while(bytesToSkip > 0)
    bytesToSkip -= dis.skip(bytesToSkip);
}

代码示例来源:origin: Netflix/hollow

public static void discardFrom(DataInputStream dis) throws IOException {
  long numLongs = VarInt.readVLong(dis);
  long bytesToSkip = numLongs * 8;
  while(bytesToSkip > 0) {
    bytesToSkip -= dis.skip(bytesToSkip);
  }
}

代码示例来源:origin: apache/hbase

HFileProtos.FileTrailerProto.PARSER.parseDelimitedFrom(inputStream);
int size = start - inputStream.available();
inputStream.skip(getTrailerSize() - NOT_PB_SIZE - size);

相关文章