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

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

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

DataInputStream.readUnsignedByte介绍

[英]See the general contract of the readUnsignedByte method of DataInput.

Bytes for this operation are read from the contained input stream.
[中]

代码示例

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

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

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

public final int readUnsignedByte () throws IOException {
  return dis.readUnsignedByte();
}

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

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

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

public final int readUnsignedByte () throws IOException {
  return dis.readUnsignedByte();
}

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

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

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

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

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

public short readShort () throws IOException {
  int a = is.read();
  int b = readUnsignedByte();
  return (short)((a << 8) | b);
}

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

public int readUnsignedShort () throws IOException {
  int a = is.read();
  int b = readUnsignedByte();
  return ((a << 8) | b);
}

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

public int readUnsignedShort () throws IOException {
  int a = is.read();
  int b = readUnsignedByte();
  return ((a << 8) | b);
}

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

public char readChar () throws IOException {
  int a = is.read();
  int b = readUnsignedByte();
  return (char)((a << 8) | b);
}

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

public char readChar () throws IOException {
  int a = is.read();
  int b = readUnsignedByte();
  return (char)((a << 8) | b);
}

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

public short readShort () throws IOException {
  int a = is.read();
  int b = readUnsignedByte();
  return (short)((a << 8) | b);
}

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

public MethodHandleInfo(DataInputStream in, int index) throws IOException {
  super(index);
  refKind = in.readUnsignedByte();
  refIndex = in.readUnsignedShort();
}

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

public int readInt () throws IOException {
  int a = is.read();
  int b = is.read();
  int c = is.read();
  int d = readUnsignedByte();
  return (a << 24) | (b << 16) | (c << 8) | d;
}

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

public int readInt () throws IOException {
  int a = is.read();
  int b = is.read();
  int c = is.read();
  int d = readUnsignedByte();
  return (a << 24) | (b << 16) | (c << 8) | d;
}

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

private int readUtfChar (StringBuilder sb) throws IOException {
  int a = readUnsignedByte();
  if ((a & 0x80) == 0) {
    sb.append((char)a);
    return 1;
  }
  if ((a & 0xe0) == 0xc0) {
    int b = readUnsignedByte();
    sb.append((char)(((a & 0x1F) << 6) | (b & 0x3F)));
    return 2;
  }
  if ((a & 0xf0) == 0xe0) {
    int b = readUnsignedByte();
    int c = readUnsignedByte();
    sb.append((char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)));
    return 3;
  }
  throw new UTFDataFormatException();
}

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

private int readUtfChar (StringBuilder sb) throws IOException {
  int a = readUnsignedByte();
  if ((a & 0x80) == 0) {
    sb.append((char)a);
    return 1;
  }
  if ((a & 0xe0) == 0xc0) {
    int b = readUnsignedByte();
    sb.append((char)(((a & 0x1F) << 6) | (b & 0x3F)));
    return 2;
  }
  if ((a & 0xf0) == 0xe0) {
    int b = readUnsignedByte();
    int c = readUnsignedByte();
    sb.append((char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)));
    return 3;
  }
  throw new UTFDataFormatException();
}

代码示例来源:origin: org.javassist/javassist

public MethodHandleInfo(DataInputStream in, int index)
    throws IOException
{
  super(index);
  refKind = in.readUnsignedByte();
  refIndex = in.readUnsignedShort();
}

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

private int readResourceInstId() throws IOException {
 int token = dataIn.readUnsignedByte();
 if (token <= MAX_BYTE_RESOURCE_INST_ID) {
  return token;
 } else if (token == ILLEGAL_RESOURCE_INST_ID_TOKEN) {
  return ILLEGAL_RESOURCE_INST_ID;
 } else if (token == SHORT_RESOURCE_INST_ID_TOKEN) {
  return dataIn.readUnsignedShort();
 } else { /* token == INT_RESOURCE_INST_ID_TOKEN */
  return dataIn.readInt();
 }
}

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

@Override
public int readUnsignedByte() {
 try {
   return getStream().readUnsignedByte();
 } catch (Exception e) {
   throw new IllegalStateException(e.getMessage(), e);
 }
}

相关文章