get the char at a specified position in the buffer
170044
public char charAt( int idx )
    {
        if ( idx < 0 )
            throw new IndexOutOfBoundsException("idx{"+idx+"} < 0");
        if ( idx >= count )
            throw new IndexOutOfBoundsException("idx{"+idx+"} >= buffer.length");
        return buff[idx];
    }
91803
def read_char
      input = $stdin.getch
      return input unless input == "\e"
      begin
        Timeout.timeout(0.01) do
          input += $stdin.getch
          input += $stdin.getch
        end
      rescue Timeout::Error
        # ignored
      end
      input
    end
905549
public char charAt(int where) {
        int len = length();
        if (where < 0) {
            throw new IndexOutOfBoundsException("charAt: " + where + " < 0");
        } else if (where >= len) {
            throw new IndexOutOfBoundsException("charAt: " + where + " >= length " + len);
        }

        if (where >= mGapStart)
            return mText[where + mGapLength];
        else
            return mText[where];
    }
1365255
public int readString(char[] buffer, int offset, int length)
        throws IOException
    {
        int readLength = 0;

        if (_chunkLength == END_OF_DATA) {
            _chunkLength = 0;
            return -1;
        }
        else if (_chunkLength == 0) {
            int tag = read();

            switch (tag) {
                case 'N':
                    return -1;

                case 'S':
                case 's':
                case 'X':
                case 'x':
                    _isLastChunk = tag == 'S' || tag == 'X';
                    _chunkLength = (read() << 8) + read();
                    break;

                default:
                    throw new IOException("expected 'S' at " + (char) tag);
            }
        }

        while (length > 0) {
            if (_chunkLength > 0) {
                buffer[offset++] = (char) parseUTF8Char();
                _chunkLength--;
                length--;
                readLength++;
            }
            else if (_isLastChunk) {
                if (readLength == 0)
                    return -1;
                else {
                    _chunkLength = END_OF_DATA;
                    return readLength;
                }
            }
            else {
                int tag = read();

                switch (tag) {
                    case 'S':
                    case 's':
                    case 'X':
                    case 'x':
                        _isLastChunk = tag == 'S' || tag == 'X';
                        _chunkLength = (read() << 8) + read();
                        break;

                    default:
                        throw new IOException("expected 'S' at " + (char) tag);
                }
            }
        }

        if (readLength == 0)
            return -1;
        else if (_chunkLength > 0 || !_isLastChunk)
            return readLength;
        else {
            _chunkLength = END_OF_DATA;
            return readLength;
        }
    }
957968
public char charAt(int index) {
        if (index < 0 || index >= this.length()) {
            throw new IndexOutOfBoundsException("index=" + index
                    + " - should be between 0 and length()=" + this.length());
        }

        // is it in the buffer
        if (index < prefixBuffer.limit()) {
            return prefixBuffer.get(index);
        }

        // otherwise we gotta get it from disk via memory map
        long charFileIndex = (long) index - (long) prefixBuffer.limit();
        long charFileLength = (long) this.length() - (long) prefixBuffer.limit(); // in characters
        if (charFileIndex * bytesPerChar < mapByteOffset) {
            logger.log(Level.WARNING,"left-fault; probably don't want to use CharSequence that far backward");
        }
        if (charFileIndex * bytesPerChar < mapByteOffset
                || charFileIndex - (mapByteOffset / bytesPerChar) >= mappedBuffer.limit()) {
            // fault
            /*
             * mapByteOffset is bounded by 0 and file size +/- size of the map,
             * and starts as close to <code>fileIndex -
             * MAP_TARGET_LEFT_PADDING_BYTES</code> as it can while also not
             * being smaller than it needs to be.
             */
            mapByteOffset = Math.min(charFileIndex * bytesPerChar - MAP_TARGET_LEFT_PADDING_BYTES, 
                                     charFileLength * bytesPerChar - MAP_MAX_BYTES);
            mapByteOffset = Math.max(0, mapByteOffset);
            updateMemoryMappedBuffer();
        }

        return mappedBuffer.get((int)(charFileIndex-(mapByteOffset/bytesPerChar))); 
    }
1216626
def backward_char(event):
    "  "
    buff = event.current_buffer
    buff.cursor_position += buff.document.get_cursor_left_position(count=event.arg)
303464
public static char getChar(MemorySegment[] segments, int offset) {
		if (inFirstSegment(segments, offset, 2)) {
			return segments[0].getChar(offset);
		} else {
			return getCharMultiSegments(segments, offset);
		}
	}
815069
def find_next_character(code, position, char):
    """"""
    end = LineCol(code, *position)
    while not end.eof and end.char() in WHITESPACE:
        end.inc()

    if not end.eof and end.char() == char:
        return end.tuple(), inc_tuple(end.tuple())
    return None, None
607704
def _getChar(self, char_spec):
        
        if len(char_spec) >= 4 and all(c in string.hexdigits for c in char_spec):
            char_number = int(char_spec, 16)
            if char_number not in range(0x110000):
                raise ValueError('No such character')
            return chr(char_number)
        elif len(char_spec) == 1:
            return char_spec
        else:
            raise ValueError('No such character')
709401
private static String getDumpBytes(WsByteBuffer buffer, int bytesToDump, boolean rewind)
   {
      // Save the current position
      int pos = buffer.position();
      if (rewind)
      {
         buffer.rewind();
      }

      byte[] data = null;
      int start;
      int count = bytesToDump;
      if (count > buffer.remaining() || count == ENTIRE_BUFFER) count = buffer.remaining();

      if (buffer.hasArray())
      {
         data = buffer.array();
         start = buffer.arrayOffset() + buffer.position();
      }
      else
      {
         data = new byte[count];
         buffer.get(data);
         start = 0;
      }

      String strData = "Dumping "+count+" bytes of buffer data:\r\n";
      if (count > 0) strData += SibTr.formatBytes(data, start, count);

      // Return the position to where it should be
      if (rewind) buffer.position(pos);

      return strData;
   }
444862
@Override
    public final char charAt(int i) {
        if (i < -len || len <= i) {
            throw new IllegalArgumentException(
                    String.format("position %d of slice length %d is not valid.", i, len));
        }
        if (i < 0) {
            i = len + i;
        }
        return fb[off + i];
    }
1131438
public final String getFixString(final int pos, final int len, String charsetName) {
        if (pos + len > limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
                                                                             + (pos < 0 ? pos : (pos + len)));

        final int from = origin + pos;
        final int end = from + len;
        byte[] buf = buffer;
        int found = from;
        for (; (found < end) && buf[found] != '\0'; found++)
            /* empty loop */;

        try {
            return new String(buf, from, found - from, charsetName);
        } catch (UnsupportedEncodingException e) {
            throw new IllegalArgumentException("Unsupported encoding: " + charsetName, e);
        }
    }
414654
@Override
    public V get(ByteBuffer b, int offset, int len) {
        int t = 0;
        for (int i = 0; i < len; i++) {
            byte c = b.get(offset + i);
            int index = __lookup[c & 0x7f];
            if (index >= 0) {
                int idx = t * ROW_SIZE + index;
                t = _rowIndex[idx];
                if (t == 0)
                    return null;
            } else {
                char[] big = _bigIndex == null ? null : _bigIndex[t];
                if (big == null)
                    return null;
                t = big[c];
                if (t == 0)
                    return null;
            }
        }
        return (V) _value[t];
    }
507015
public char charAt(int pos)
  {
    int startChunk = pos >>> m_chunkBits;

    if (startChunk == 0 && m_innerFSB != null)
      return m_innerFSB.charAt(pos & m_chunkMask);
    else
      return m_array[startChunk][pos & m_chunkMask];
  }
573554
public int read(char []buf, int offset, int length)
    throws IOException
  {
    for (int i = 0; i < length; i++) {
      int ch = is.read();

      if (ch < 0)
        return i > 0 ? i : -1;
      else {
        buf[offset + i] = (char) ch;
      }
    }
      
    return length;
  }
163048
public void getChars(int start, int end, char[] buffer, int index) {
		sb.getChars(start, end, buffer, index);
	}
1182603
def display_char(self,x,y,char):
	
	self.send_cmd("T"+str(x+1)+","+str(y+1)+","+char)