Package java.nio

Examples of java.nio.ReadOnlyBufferException


    /*
     * If static buffer is RO, we can not convert it to RW. Only dynamic buffers
     * can be converted.
     */
    if (b.isReadOnly() && staticBuffer != null) {
      throw new ReadOnlyBufferException();
    }

    if (b.isReadOnly()) {

      final long global = handle.getPositionGlobal();
View Full Code Here


  private final void throwIfNoAppend() {
    if (this.append) {
      return;
    }

    throw new ReadOnlyBufferException();
  }
View Full Code Here

  private final void throwIfReadonly() {
    if (this.readonly == false) {
      return;
    }

    throw new ReadOnlyBufferException();
  }
View Full Code Here

    /*
     * If static buffer is RO, we can not convert it to RW. Only dynamic buffers
     * can be converted.
     */
    if (b.isReadOnly() && bits != null) {
      throw new ReadOnlyBufferException();
    }

    if (b.isReadOnly()) {

      final long global = handle.getPositionGlobal();
View Full Code Here

   * @param position The position at which the byte will be written
   * @param value The byte value to be written
   * @return This buffer
   */
  public DoubleHalfBuffer put(int position, byte value){
    if(readOnly) throw new ReadOnlyBufferException();
    if(position >= limit) throw new BufferOverflowException();
    if(position < firstLimit) firstBuffer.put(position, value);
    else secondBuffer.put(position - firstLimit, value);
    return this;
  }
View Full Code Here

   * @param offset Start position inside the given array
   * @param length Number of bytes to put.
   * @return This buffer
   */
  public DoubleHalfBuffer put(byte[] src, int offset, int length){
    if(readOnly) throw new ReadOnlyBufferException();
    if(remaining() < length) throw new BufferOverflowException();
    if(offset < 0 || length < 0 || offset + length > src.length) throw new IndexOutOfBoundsException();
    if(position >= firstLimit){
      secondBuffer.position(position - firstLimit);
      secondBuffer.put(src, offset, length);
View Full Code Here

    /**
     * @see ByteBuffer#put(byte)
     */
    public IoBuffer put(byte b) {
        if (readonly) {
            throw new ReadOnlyBufferException();
        }
        if (position.getPosition() >= limit.getPosition()) {
            throw new BufferUnderflowException();
        }

View Full Code Here

        if (remaining() < src.remaining()) {
            throw new BufferOverflowException();
        }
        if (isReadOnly()) {
            throw new ReadOnlyBufferException();
        }

        while (src.hasRemaining()) {
            put(src.get());
        }
View Full Code Here

        if (remaining() < src.remaining()) {
            throw new BufferOverflowException();
        }
        if (isReadOnly()) {
            throw new ReadOnlyBufferException();
        }

        while (src.hasRemaining()) {
            put(src.get());
        }
View Full Code Here

    /**
     * @see ByteBuffer#put(byte[], int, int)
     */
    public IoBuffer put(byte[] src, int offset, int length) {
        if (readonly) {
            throw new ReadOnlyBufferException();
        }
        if (remaining() < length) {
            throw new BufferUnderflowException();
        }

View Full Code Here

TOP

Related Classes of java.nio.ReadOnlyBufferException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.