java.io.ByteArrayInputStream.mark()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(206)

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

ByteArrayInputStream.mark介绍

[英]The current mark position. Initially set to 0 or the offset parameter within the constructor.
[中]当前标记位置。最初在构造函数中设置为0或offset参数。

代码示例

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

@Override
public void mark(int arg0) {
 getByteArrayInputStream().mark(arg0);
}

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

bais.mark(bais.available());
Record txn = null;
switch (hdr.getType()) {

代码示例来源:origin: org.apache.zookeeper/zookeeper

bais.mark(bais.available());
Record txn = null;
switch (hdr.getType()) {

代码示例来源:origin: devnied/EMV-NFC-Paycard-Enrollment

stream.mark(0);
int peekInt = stream.read();
byte peekByte = (byte) peekInt;
  stream.mark(0); // Current position
  peekInt = stream.read();
  peekByte = (byte) peekInt;
stream.mark(0);
int posBefore = stream.available();
  stream.mark(0);
  int prevOctet = 1;
  int curOctet;
stream.mark(0);
peekInt = stream.read();
peekByte = (byte) peekInt;
while (peekInt != -1 && (peekByte == (byte) 0xFF || peekByte == (byte) 0x00)) {
  stream.mark(0);
  peekInt = stream.read();
  peekByte = (byte) peekInt;

代码示例来源:origin: devnied/EMV-NFC-Paycard-Enrollment

buf.append("\n");
if (stream.available() == 2) {
  stream.mark(0);
  byte[] value = new byte[2];
  try {

代码示例来源:origin: Erudika/para

@Override
  public synchronized void mark(int readlimit) {
    bais.mark(readlimit);
  }
}

代码示例来源:origin: com.erudika/para-server

@Override
  public synchronized void mark(int readlimit) {
    bais.mark(readlimit);
  }
}

代码示例来源:origin: org.mule.transports/mule-transport-servlet

@Override
public synchronized void mark(int readlimit)
{
  this.cachedStream.mark(readlimit);
}

代码示例来源:origin: org.shoal/shoal-cache

public int mark() {
  super.mark(0);
  return super.pos;
}

代码示例来源:origin: airlift/airship

@Override
public void mark(int readlimit)
{
  stream.mark(readlimit);
}

代码示例来源:origin: org.springframework.data/spring-data-riak

@Override
public void mark(int i) {
 in.mark(i);
}

代码示例来源:origin: Johnnei/JavaTorrent

/**
 * Marks the current position.
 */
public void mark() {
  buffer.mark(buffer.available());
}

代码示例来源:origin: stackoverflow.com

ByteArrayInputStream is = new ByteArrayInputStream("Hello World!!".getBytes());
 if(is.markSupported()){
   is.mark("Hello World!!".length());
 }
 System.out.println(getStreamContent(is));
 is.reset();
 System.out.println("Printed once");
 System.out.println(getStreamContent(is));

代码示例来源:origin: com.microsoft.azure/azure-storage

@Override
  public void recoveryAction(OperationContext context) throws IOException {
    blockListInputStream.reset();
    blockListInputStream.mark(Constants.MAX_MARK_LENGTH);
  }
};

代码示例来源:origin: com.microsoft.azure/azure-storage

@Override
  public void recoveryAction(OperationContext context) throws IOException {
    sendStream.reset();
    sendStream.mark(Constants.MAX_MARK_LENGTH);
  }
};

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
  public void recoveryAction(OperationContext context) throws IOException {
    blockListInputStream.reset();
    blockListInputStream.mark(Constants.MAX_MARK_LENGTH);
  }
};

代码示例来源:origin: Azure/azure-storage-android

@Override
  public void recoveryAction(OperationContext context) throws IOException {
    sendStream.reset();
    sendStream.mark(Constants.MAX_MARK_LENGTH);
  }
};

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
  public void recoveryAction(OperationContext context) throws IOException {
    sendStream.reset();
    sendStream.mark(Constants.MAX_MARK_LENGTH);
  }
};

代码示例来源:origin: baidubce/bce-sdk-java

public static RestartableInputStream wrap(byte[] b) {
    ByteArrayInputStream input = new ByteArrayInputStream(b);
    input.mark(b.length);
    return new RestartableResettableInputStream(input);
  }
}

代码示例来源:origin: com.kloudtek.ktutils/ktutils

@Override
public synchronized void mark(int readlimit) {
  try {
    getDataStream().mark(readlimit);
  } catch (IOException e) {
    throw new RuntimeException(e.getMessage(),e);
  }
}

相关文章