java.nio.Buffer.isReadOnly()方法的使用及代码示例

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

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

Buffer.isReadOnly介绍

[英]Indicates whether this buffer is read-only.
[中]指示此缓冲区是否为只读。

代码示例

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

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

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

/**
 * Assert the writability of the given buffers.
 *
 * @param buffers the buffers array
 * @param offs the offset in the array to start searching
 * @param len the number of buffers to check
 * @throws ReadOnlyBufferException if any of the buffers are read-only
 */
public static void assertWritable(Buffer[] buffers, int offs, int len) throws ReadOnlyBufferException {
  for (int i = 0; i < len; i ++) {
    if (buffers[i + offs].isReadOnly()) {
      throw msg.readOnlyBuffer();
    }
  }
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

if (data != null && data.isReadOnly()) {
  throw new IllegalArgumentException( "VertexBuffer data cannot be read-only." );

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

if (data.isReadOnly()) {
  throw new IllegalArgumentException("VertexBuffer data cannot be read-only.");

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

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

代码示例来源:origin: com.metsci.glimpse/glimpse-util

public boolean isReadOnlyt( )
{
  return _buffer.isReadOnly( );
}

代码示例来源:origin: ibinti/bugvm

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

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

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

代码示例来源:origin: FlexoVM/flexovm

final void checkWritable() {
  if (isReadOnly()) {
    throw new IllegalArgumentException("Read-only buffer");
  }
}

代码示例来源:origin: com.jtransc/jtransc-rt

final void checkWritable() {
  if (isReadOnly()) throw new IllegalArgumentException("Read-only buffer");
}

代码示例来源:origin: com.jtransc/jtransc-rt

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count)
    throw new IndexOutOfBoundsException("offset=" + offset +
      ", count=" + count + ", length=" + length);
  if (byteCount > remaining()) throw new BufferOverflowException();
  if (isReadOnly()) throw new ReadOnlyBufferException();
  return byteCount;
}

代码示例来源:origin: ibinti/bugvm

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

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

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

代码示例来源:origin: com.gluonhq/robovm-rt

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

代码示例来源:origin: com.bugvm/bugvm-rt

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

代码示例来源:origin: FlexoVM/flexovm

int checkPutBounds(int bytesPerElement, int length, int offset, int count) {
  int byteCount = bytesPerElement * count;
  if ((offset | count) < 0 || offset > length || length - offset < count) {
    throw new IndexOutOfBoundsException("offset=" + offset +
        ", count=" + count + ", length=" + length);
  }
  if (byteCount > remaining()) {
    throw new BufferOverflowException();
  }
  if (isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  return byteCount;
}

相关文章