Package java.nio.channels

Examples of java.nio.channels.IllegalBlockingModeException


            if (0 > offset || 0 > count || count + offset > buffer.length) {
                throw new IndexOutOfBoundsException();
            }
            ByteBuffer buf = ByteBuffer.wrap(buffer, offset, count);
            if (!channel.isBlocking()) {
                throw new IllegalBlockingModeException();
            }
            channel.write(buf);
        }
View Full Code Here


         * @see java.io.OutputStream#write(int)
         */
        @Override
        public void write(int oneByte) throws IOException {
            if (!channel.isBlocking()) {
                throw new IllegalBlockingModeException();
            }
            ByteBuffer buffer = ByteBuffer.allocate(1);
            buffer.put(0, (byte) (oneByte & 0xFF));
            channel.write(buffer);
        }
View Full Code Here

         * @see java.io.InputStream#read()
         */
        @Override
        public int read() throws IOException {
            if (!channel.isBlocking()) {
                throw new IllegalBlockingModeException();
            }
            ByteBuffer buf = ByteBuffer.allocate(1);
            int result = channel.read(buf);
            return (-1 == result) ? result : buf.get() & 0xFF;
        }
View Full Code Here

                throws IOException {
            if (0 > offset || 0 > count || count + offset > buffer.length) {
                throw new IndexOutOfBoundsException();
            }
            if (!channel.isBlocking()) {
                throw new IllegalBlockingModeException();
            }
            ByteBuffer buf = ByteBuffer.wrap(buffer, offset, count);
            return channel.read(buf);
        }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new IllegalBlockingModeException());
    }
View Full Code Here

     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest
                .verifyGolden(this, new IllegalBlockingModeException());
    }
View Full Code Here

      if (key == null) {
        // this channel is independent of any selector
        log.error("UDT channel is in non blocking mode;"
            + "must register with a selector "
            + "before trying to connect()");
        throw new IllegalBlockingModeException();
      } else {
        // this channel is registered with a selector
        key.selectorUDT.submitConnectRequest(key, remoteSocket);
        /*
         * connection operation must later be completed by invoking the
View Full Code Here

   *            The UDT socket.
   */
  public NetInputStreamUDT(final SocketUDT socketUDT) {

    if (!socketUDT.isBlocking()) {
      throw new IllegalBlockingModeException();
    }

    this.socketUDT = socketUDT;

  }
View Full Code Here

   *            The UDT socket.
   */
  public NetOutputStreamUDT(final SocketUDT socketUDT) {

    if (!socketUDT.isBlocking()) {
      throw new IllegalBlockingModeException();
    }

    this.socketUDT = socketUDT;

  }
View Full Code Here

      if (key == null) {
        // this channel is independent of any selector
        log.error("UDT channel is in non blocking mode;"
            + "must register with a selector "
            + "before trying to connect()");
        throw new IllegalBlockingModeException();
      } else {
        // this channel is registered with a selector
        key.selectorUDT.submitConnectRequest(key, remoteSocket);
        /*
         * connection operation must later be completed by invoking the
View Full Code Here

TOP

Related Classes of java.nio.channels.IllegalBlockingModeException

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.