Package java.lang

Examples of java.lang.ArrayIndexOutOfBoundsException


    {
        int ch = m_content[m_index++];
      if (ch == 0)
        done = true;
      else if (m_index > m_content.length)
        throw new ArrayIndexOutOfBoundsException("no string terminator found @"+m_index); //$NON-NLS-1$
    }

    /* build a new string and return it */
    String s;
    try
View Full Code Here


   * @param bytes how many bytes should be written
   */
  public void put(long val, int bytes) throws ArrayIndexOutOfBoundsException
  {
    if (m_index+bytes > m_content.length)
      throw new ArrayIndexOutOfBoundsException(m_content.length-m_index+" < "+bytes); //$NON-NLS-1$

    for (int i=0; i<bytes; ++i)
      m_content[m_index++] = (byte)(val >> 8*i);

    debugAppendNumber(val, bytes);
View Full Code Here

    byte[] bytes = s.getBytes("UTF-8"); //$NON-NLS-1$
    int length = bytes.length;
    int endAt = m_index + length + 1;

    if (endAt > m_content.length)
      throw new ArrayIndexOutOfBoundsException(endAt+" > "+m_content.length); //$NON-NLS-1$

    /* copy the string as a byte array */
    System.arraycopy(bytes, 0, m_content, m_index, length);
    m_index += length;

View Full Code Here

  }

  private long get(int bytes) throws ArrayIndexOutOfBoundsException
  {
    if (m_index+bytes > m_content.length)
      throw new ArrayIndexOutOfBoundsException(m_content.length-m_index+" < "+bytes); //$NON-NLS-1$

    long value = 0;
    for (int i=0; i<bytes; ++i) {
      long byteValue = m_content[m_index++] & 0xff;
      long byteValueShifted = byteValue << (8*i);
 
View Full Code Here

    {
        int ch = m_content[m_index++];
      if (ch == 0)
        done = true;
      else if (m_index > m_content.length)
        throw new ArrayIndexOutOfBoundsException("no string terminator found @"+m_index); //$NON-NLS-1$
    }

    /* build a new string and return it */
    String s;
    try
View Full Code Here

   * @param bytes how many bytes should be written
   */
  public void put(long val, int bytes) throws ArrayIndexOutOfBoundsException
  {
    if (m_index+bytes > m_content.length)
      throw new ArrayIndexOutOfBoundsException(m_content.length-m_index+" < "+bytes); //$NON-NLS-1$

    for (int i=0; i<bytes; ++i)
      m_content[m_index++] = (byte)(val >> 8*i);

    debugAppendNumber(val, bytes);
View Full Code Here

    byte[] bytes = s.getBytes("UTF-8"); //$NON-NLS-1$
    int length = bytes.length;
    int endAt = m_index + length + 1;

    if (endAt > m_content.length)
      throw new ArrayIndexOutOfBoundsException(endAt+" > "+m_content.length); //$NON-NLS-1$

    /* copy the string as a byte array */
    System.arraycopy(bytes, 0, m_content, m_index, length);
    m_index += length;

View Full Code Here

TOP

Related Classes of java.lang.ArrayIndexOutOfBoundsException

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.