java.nio.BufferUnderflowException#getMessage ( )源码实例Demo

下面列出了java.nio.BufferUnderflowException#getMessage ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: bazel   文件: CompactPersistentActionCache.java
/**
 * @return non-null error description if indexer contains no data or integrity check has failed,
 *     and null otherwise
 */
private static String validateIntegrity(int indexerSize, byte[] validationRecord) {
  if (indexerSize == 0) {
    return "empty index";
  }
  if (validationRecord == null) {
    return "no validation record";
  }
  try {
    int validationSize = ByteBuffer.wrap(validationRecord).asIntBuffer().get();
    if (validationSize <= indexerSize) {
      return null;
    } else {
      return String.format("Validation mismatch: validation entry %d is too large " +
                           "compared to index size %d", validationSize, indexerSize);
    }
  } catch (BufferUnderflowException e) {
    return e.getMessage();
  }
}
 
源代码2 项目: Bytecoder   文件: ModuleInfo.java
@Override
public void readFully(byte b[], int off, int len) throws IOException {
    try {
        bb.get(b, off, len);
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码3 项目: Bytecoder   文件: ModuleInfo.java
@Override
public boolean readBoolean() throws IOException {
    try {
        int ch = bb.get();
        return (ch != 0);
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码4 项目: Bytecoder   文件: ModuleInfo.java
@Override
public byte readByte() throws IOException {
    try {
        return bb.get();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码5 项目: Bytecoder   文件: ModuleInfo.java
@Override
public int readUnsignedByte() throws IOException {
    try {
        return ((int) bb.get()) & 0xff;
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码6 项目: Bytecoder   文件: ModuleInfo.java
@Override
public short readShort() throws IOException {
    try {
        return bb.getShort();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码7 项目: Bytecoder   文件: ModuleInfo.java
@Override
public int readUnsignedShort() throws IOException {
    try {
        return ((int) bb.getShort()) & 0xffff;
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码8 项目: Bytecoder   文件: ModuleInfo.java
@Override
public char readChar() throws IOException {
    try {
        return bb.getChar();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码9 项目: Bytecoder   文件: ModuleInfo.java
@Override
public int readInt() throws IOException {
    try {
        return bb.getInt();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码10 项目: Bytecoder   文件: ModuleInfo.java
@Override
public long readLong() throws IOException {
    try {
        return bb.getLong();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码11 项目: Bytecoder   文件: ModuleInfo.java
@Override
public float readFloat() throws IOException {
    try {
        return bb.getFloat();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码12 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public void readFully(byte b[], int off, int len) throws IOException {
    try {
        bb.get(b, off, len);
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码13 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public boolean readBoolean() throws IOException {
    try {
        int ch = bb.get();
        return (ch != 0);
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码14 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public float readFloat() throws IOException {
    try {
        return bb.getFloat();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码15 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public int readUnsignedByte() throws IOException {
    try {
        return ((int) bb.get()) & 0xff;
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码16 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public double readDouble() throws IOException {
    try {
        return bb.getDouble();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码17 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public int readUnsignedShort() throws IOException {
    try {
        return ((int) bb.getShort()) & 0xffff;
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码18 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public char readChar() throws IOException {
    try {
        return bb.getChar();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码19 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public int readInt() throws IOException {
    try {
        return bb.getInt();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}
 
源代码20 项目: openjdk-jdk9   文件: ModuleInfo.java
@Override
public long readLong() throws IOException {
    try {
        return bb.getLong();
    } catch (BufferUnderflowException e) {
        throw new EOFException(e.getMessage());
    }
}