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

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

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

DataInputStream.skipBytes介绍

[英]Skips count number of bytes in this stream. Subsequent read()s will not return these bytes unless reset() is used. This method will not throw an EOFException if the end of the input is reached before count bytes where skipped.
[中]跳过此流中的字节数计数。除非使用reset(),否则后续读取()将不会返回这些字节。如果在跳过计数字节之前到达输入的末尾,则此方法不会引发EOFEException。

代码示例

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

@Override
  public final int skipBytes(int n) throws IOException {
    return in.skipBytes(n);
  }
}

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

public int skipBytes (int n) throws IOException {
  return din.skipBytes(n);
}

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

public int skipBytes (int n) throws IOException {
  return dis.skipBytes(n);
}

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

public int skipBytes (int n) throws IOException {
  return din.skipBytes(n);
}

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

public int skipBytes (int n) throws IOException {
  return dis.skipBytes(n);
}

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

@Override
  public final int skipBytes(int n) throws IOException {
    return in.skipBytes(n);
  }
}

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

@Override
  public final int skipBytes(int n) throws IOException {
    return in.skipBytes(n);
  }
}

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

private void skipBytes(int count) throws IOException {
 int skipped = dataIn.skipBytes(count);
 while (skipped != count) {
  count -= skipped;
  skipped = dataIn.skipBytes(count);
 }
}

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

@Override
public int skipBytes(int n) throws IOException {
 int result = this.dis.skipBytes(n);
 this.count += result;
 return result;
}

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

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

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

public final int skipBytes(int n) throws IOException {
    return in.skipBytes(n);
  }
}

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

/**
   * <p>
   * Skip over bytes in the stream. See the general contract of the <code>skipBytes</code> method of <code>DataInput</code>.
   * </p>
   * Bytes for this operation are read from the contained input stream.
   * 
   * @param n
   *            the number of bytes to be skipped.
   * 
   * @return the actual number of bytes skipped.
   * 
   * @throws IOException
   *             if an I/O error occurs.
   */
  public final int skipBytes(int n) throws IOException {
    return dis.skipBytes(n);
  }
}// end class LEDataInputStream

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

/**
   * <p>
   * Skip over bytes in the stream. See the general contract of the <code>skipBytes</code> method of <code>DataInput</code>.
   * </p>
   * Bytes for this operation are read from the contained input stream.
   * 
   * @param n
   *            the number of bytes to be skipped.
   * 
   * @return the actual number of bytes skipped.
   * 
   * @throws IOException
   *             if an I/O error occurs.
   */
  public final int skipBytes(int n) throws IOException {
    return dis.skipBytes(n);
  }
}// end class LEDataInputStream

代码示例来源:origin: KronicDeth/intellij-elixir

@Nullable
public static Chunk from(@NotNull DataInputStream dataInputStream, @NotNull String path) throws IOException {
  String typeID = typeID(dataInputStream, path);
  Chunk chunk = null;
  if (typeID != null) {
    long length = length(dataInputStream);
    byte[] data = new byte[(int) length];
    dataInputStream.readFully(data);
    int padding = (int) ((ALIGNMENT - (length % ALIGNMENT)) % ALIGNMENT);
    dataInputStream.skipBytes(padding);
    chunk = new Chunk(typeID, data);
  }
  return chunk;
}

代码示例来源:origin: nutzam/nutz

if (start > big4G) {
  start -= big4G;
  in.skipBytes(big4G);
} else {
  in.skipBytes((int) start);
  break;

代码示例来源:origin: GlowstoneMC/Glowstone

/**
 * Reads the root NBT {@link CompoundTag} from the stream.
 *
 * @param readLimiter The read limiter to prevent overflow when reading the NBT data.
 * @return The tag that was read.
 * @throws IOException if an I/O error occurs.
 */
public CompoundTag readCompound(NbtReadLimiter readLimiter) throws IOException {
  // read type
  TagType type = TagType.byIdOrError(is.readUnsignedByte());
  if (type != TagType.COMPOUND) {
    throw new IOException("Root of NBTInputStream was " + type + ", not COMPOUND");
  }
  // for now, throw away name
  int nameLength = is.readUnsignedShort();
  is.skipBytes(nameLength);
  // read tag
  return (CompoundTag) readTagPayload(type, 0, readLimiter);
}

代码示例来源:origin: fesh0r/fernflower

case TypeAnnotation.TYPE_ARG_CONSTRUCTOR_REF:
case TypeAnnotation.TYPE_ARG_METHOD_REF:
 data.skipBytes(3);
 break;
 data.skipBytes(data.readUnsignedShort() * 6);
 break;

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

throwZipException(filename, localRaf.length(), entry.getName(), entry.localHeaderRelOffset, "Local File Header", localMagic);
is.skipBytes(2);
is.skipBytes(18);
int fileNameLength = Short.reverseBytes(is.readShort()) & 0xffff;
int extraFieldLength = Short.reverseBytes(is.readShort()) & 0xffff;

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

is.skipBytes(2);
is.skipBytes(18);
int fileNameLength = Short.reverseBytes(is.readShort()) & 0xffff;
int extraFieldLength = Short.reverseBytes(is.readShort()) & 0xffff;

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

if (valIn.skipBytes(skipValBytes) != skipValBytes) {
 throw new IOException("Failed to seek to " + currentKey + 
            "(th) value!");

相关文章