code: public static int read(ReadableByteChannel ch, ByteBuffer bb)
          throws IOException
      {
          if (ch instanceof SelectableChannel) {
              SelectableChannel sc = (SelectableChannel)ch;
              synchronized (sc.blockingLock()) {
                  boolean bm = sc.isBlocking();
                  if (!bm)
                      throw new IllegalBlockingModeException();
                  // Android-removed.
                  // if (bm != block)
                  //    sc.configureBlocking(block);
                  int n = ch.read(bb);
                  // Android-removed.
                  // if (bm != block)
                  //     sc.configureBlocking(bm);
                  return n;
              }
          } else {
              return ch.read(bb);
          }
      }
docs: read(ReadableByteChannel,ByteBuffer, boolean block)