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

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

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

DataInputStream.markSupported介绍

暂无

代码示例

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

@Override
public boolean markSupported() {
  return in.markSupported();
}

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

@Override
public boolean markSupported() {
  return in.markSupported();
}

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

@Override
public boolean markSupported() {
  return in.markSupported();
}

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

@Override
public boolean markSupported() {
  return in.markSupported();
}

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

public StatArchiveFile(StatArchiveReader reader, File archiveName, boolean dump,
  ValueFilter[] filters) throws IOException {
 this.reader = reader;
 this.archiveName = archiveName;
 this.dump = dump;
 this.compressed = archiveName.getPath().endsWith(".gz");
 this.is = new FileInputStream(this.archiveName);
 if (this.compressed) {
  this.dataIn = new DataInputStream(
    new BufferedInputStream(new GZIPInputStream(this.is, BUFFER_SIZE), BUFFER_SIZE));
 } else {
  this.dataIn = new DataInputStream(new BufferedInputStream(this.is, BUFFER_SIZE));
 }
 this.updateOK = this.dataIn.markSupported();
 this.filters = createFilters(filters);
}

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

/**
 * Parses an RegionInfo instance from the passed in stream.
 * Presumes the RegionInfo was serialized to the stream with
 * {@link #toDelimitedByteArray(RegionInfo)}.
 * @param in
 * @return An instance of RegionInfo.
 * @throws IOException
 */
static RegionInfo parseFrom(final DataInputStream in) throws IOException {
 // I need to be able to move back in the stream if this is not a pb
 // serialization so I can do the Writable decoding instead.
 int pblen = ProtobufUtil.lengthOfPBMagic();
 byte [] pbuf = new byte[pblen];
 if (in.markSupported()) { //read it with mark()
  in.mark(pblen);
 }
 //assumption: if Writable serialization, it should be longer than pblen.
 int read = in.read(pbuf);
 if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
 if (ProtobufUtil.isPBMagicPrefix(pbuf)) {
  return ProtobufUtil.toRegionInfo(HBaseProtos.RegionInfo.parseDelimitedFrom(in));
 } else {
  throw new IOException("PB encoded RegionInfo expected");
 }
}

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

if (in.markSupported()) in.mark(pblen);
int read = in.read(pbuf);
if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
 parsePB(HFileProtos.FileInfoProto.parseDelimitedFrom(in));
} else {
 if (in.markSupported()) {
  in.reset();
  parseWritable(in);

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

/**
 * Parses an HRegionInfo instance from the passed in stream.  Presumes the HRegionInfo was
 * serialized to the stream with {@link #toDelimitedByteArray()}
 * @param in
 * @return An instance of HRegionInfo.
 * @throws IOException
 * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
 *             Use {@link RegionInfo#parseFrom(DataInputStream)}.
 */
@Deprecated
@InterfaceAudience.Private
public static HRegionInfo parseFrom(final DataInputStream in) throws IOException {
 // I need to be able to move back in the stream if this is not a pb serialization so I can
 // do the Writable decoding instead.
 int pblen = ProtobufUtil.lengthOfPBMagic();
 byte [] pbuf = new byte[pblen];
 if (in.markSupported()) { //read it with mark()
  in.mark(pblen);
 }
 //assumption: if Writable serialization, it should be longer than pblen.
 int read = in.read(pbuf);
 if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
 if (ProtobufUtil.isPBMagicPrefix(pbuf)) {
  return convert(HBaseProtos.RegionInfo.parseDelimitedFrom(in));
 } else {
  throw new IOException("PB encoded HRegionInfo expected");
 }
}

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

@Override
  public boolean markSupported() {
    return in.markSupported();
  }
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * Parses an HRegionInfo instance from the passed in stream.  Presumes the HRegionInfo was
 * serialized to the stream with {@link #toDelimitedByteArray()}
 * @param in
 * @return An instance of HRegionInfo.
 * @throws IOException
 * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
 *             Use {@link RegionInfo#parseFrom(DataInputStream)}.
 */
@Deprecated
@InterfaceAudience.Private
public static HRegionInfo parseFrom(final DataInputStream in) throws IOException {
 // I need to be able to move back in the stream if this is not a pb serialization so I can
 // do the Writable decoding instead.
 int pblen = ProtobufUtil.lengthOfPBMagic();
 byte [] pbuf = new byte[pblen];
 if (in.markSupported()) { //read it with mark()
  in.mark(pblen);
 }
 //assumption: if Writable serialization, it should be longer than pblen.
 int read = in.read(pbuf);
 if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
 if (ProtobufUtil.isPBMagicPrefix(pbuf)) {
  return convert(HBaseProtos.RegionInfo.parseDelimitedFrom(in));
 } else {
  throw new IOException("PB encoded HRegionInfo expected");
 }
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * Parses an RegionInfo instance from the passed in stream.
 * Presumes the RegionInfo was serialized to the stream with
 * {@link #toDelimitedByteArray(RegionInfo)}.
 * @param in
 * @return An instance of RegionInfo.
 * @throws IOException
 */
static RegionInfo parseFrom(final DataInputStream in) throws IOException {
 // I need to be able to move back in the stream if this is not a pb
 // serialization so I can do the Writable decoding instead.
 int pblen = ProtobufUtil.lengthOfPBMagic();
 byte [] pbuf = new byte[pblen];
 if (in.markSupported()) { //read it with mark()
  in.mark(pblen);
 }
 //assumption: if Writable serialization, it should be longer than pblen.
 int read = in.read(pbuf);
 if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
 if (ProtobufUtil.isPBMagicPrefix(pbuf)) {
  return ProtobufUtil.toRegionInfo(HBaseProtos.RegionInfo.parseDelimitedFrom(in));
 } else {
  throw new IOException("PB encoded RegionInfo expected");
 }
}

代码示例来源:origin: org.apache.tika/tika-parsers

@Override
  public boolean markSupported() {
    return in.markSupported();
  }
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers

@Override
  public boolean markSupported() {
    return in.markSupported();
  }
}

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

@Override
public boolean markSupported() {
  return in.markSupported();
}

代码示例来源:origin: apache/activemq-artemis

@Override
public boolean markSupported() {
  return in.markSupported();
}

代码示例来源:origin: com.aliyun.openservices/ons-client

@Override
public boolean markSupported() {
  return in.markSupported();
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public boolean markSupported() {
  return in.markSupported();
}

代码示例来源:origin: io.bitsensor/proto

@Override
public boolean markSupported() {
  return in.markSupported();
}

代码示例来源:origin: org.apache.apex/apex-shaded-ning19

@Override
public boolean markSupported() {
  return in.markSupported();
}

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

public MessageUnpacker(InputStream str) {
  if (str instanceof DataInputStream) {
    this.stream = (DataInputStream) str;
  } else {
    this.stream = new DataInputStream(str);
  }
  checkState(this.stream.markSupported());
}

相关文章