jdk/src/java.base/share/classes/java/lang/String.java
changeset 27955 8d98ed07bc28
parent 27087 de850fa3be4d
child 28423 0bf78b38bc0b
equal deleted inserted replaced
27953:03e0e3891572 27955:8d98ed07bc28
   182      *
   182      *
   183      * @param  count
   183      * @param  count
   184      *         The length
   184      *         The length
   185      *
   185      *
   186      * @throws  IndexOutOfBoundsException
   186      * @throws  IndexOutOfBoundsException
   187      *          If the {@code offset} and {@code count} arguments index
   187      *          If {@code offset} is negative, {@code count} is negative, or
   188      *          characters outside the bounds of the {@code value} array
   188      *          {@code offset} is greater than {@code value.length - count}
   189      */
   189      */
   190     public String(char value[], int offset, int count) {
   190     public String(char value[], int offset, int count) {
   191         if (offset < 0) {
   191         if (offset < 0) {
   192             throw new StringIndexOutOfBoundsException(offset);
   192             throw new StringIndexOutOfBoundsException(offset);
   193         }
   193         }
   222      * @throws  IllegalArgumentException
   222      * @throws  IllegalArgumentException
   223      *          If any invalid Unicode code point is found in {@code
   223      *          If any invalid Unicode code point is found in {@code
   224      *          codePoints}
   224      *          codePoints}
   225      *
   225      *
   226      * @throws  IndexOutOfBoundsException
   226      * @throws  IndexOutOfBoundsException
   227      *          If the {@code offset} and {@code count} arguments index
   227      *          If {@code offset} is negative, {@code count} is negative, or
   228      *          characters outside the bounds of the {@code codePoints} array
   228      *          {@code offset} is greater than {@code codePoints.length - count}
   229      *
   229      *
   230      * @since  1.5
   230      * @since  1.5
   231      */
   231      */
   232     public String(int[] codePoints, int offset, int count) {
   232     public String(int[] codePoints, int offset, int count) {
   233         if (offset < 0) {
   233         if (offset < 0) {
   295      *         The initial offset
   295      *         The initial offset
   296      * @param  count
   296      * @param  count
   297      *         The length
   297      *         The length
   298      *
   298      *
   299      * @throws  IndexOutOfBoundsException
   299      * @throws  IndexOutOfBoundsException
   300      *          If the {@code offset} or {@code count} argument is invalid
   300      *          If {@code offset} is negative, {@code count} is negative, or
       
   301      *          {@code offset} is greater than {@code ascii.length - count}
   301      *
   302      *
   302      * @see  #String(byte[], int)
   303      * @see  #String(byte[], int)
   303      * @see  #String(byte[], int, int, java.lang.String)
   304      * @see  #String(byte[], int, int, java.lang.String)
   304      * @see  #String(byte[], int, int, java.nio.charset.Charset)
   305      * @see  #String(byte[], int, int, java.nio.charset.Charset)
   305      * @see  #String(byte[], int, int)
   306      * @see  #String(byte[], int, int)
   399      *
   400      *
   400      * @throws  UnsupportedEncodingException
   401      * @throws  UnsupportedEncodingException
   401      *          If the named charset is not supported
   402      *          If the named charset is not supported
   402      *
   403      *
   403      * @throws  IndexOutOfBoundsException
   404      * @throws  IndexOutOfBoundsException
   404      *          If the {@code offset} and {@code length} arguments index
   405      *          If {@code offset} is negative, {@code length} is negative, or
   405      *          characters outside the bounds of the {@code bytes} array
   406      *          {@code offset} is greater than {@code bytes.length - length}
   406      *
   407      *
   407      * @since  1.1
   408      * @since  1.1
   408      */
   409      */
   409     public String(byte bytes[], int offset, int length, String charsetName)
   410     public String(byte bytes[], int offset, int length, String charsetName)
   410             throws UnsupportedEncodingException {
   411             throws UnsupportedEncodingException {
   437      * @param  charset
   438      * @param  charset
   438      *         The {@linkplain java.nio.charset.Charset charset} to be used to
   439      *         The {@linkplain java.nio.charset.Charset charset} to be used to
   439      *         decode the {@code bytes}
   440      *         decode the {@code bytes}
   440      *
   441      *
   441      * @throws  IndexOutOfBoundsException
   442      * @throws  IndexOutOfBoundsException
   442      *          If the {@code offset} and {@code length} arguments index
   443      *          If {@code offset} is negative, {@code length} is negative, or
   443      *          characters outside the bounds of the {@code bytes} array
   444      *          {@code offset} is greater than {@code bytes.length - length}
   444      *
   445      *
   445      * @since  1.6
   446      * @since  1.6
   446      */
   447      */
   447     public String(byte bytes[], int offset, int length, Charset charset) {
   448     public String(byte bytes[], int offset, int length, Charset charset) {
   448         if (charset == null)
   449         if (charset == null)
   522      *
   523      *
   523      * @param  length
   524      * @param  length
   524      *         The number of bytes to decode
   525      *         The number of bytes to decode
   525      *
   526      *
   526      * @throws  IndexOutOfBoundsException
   527      * @throws  IndexOutOfBoundsException
   527      *          If the {@code offset} and the {@code length} arguments index
   528      *          If {@code offset} is negative, {@code length} is negative, or
   528      *          characters outside the bounds of the {@code bytes} array
   529      *          {@code offset} is greater than {@code bytes.length - length}
   529      *
   530      *
   530      * @since  1.1
   531      * @since  1.1
   531      */
   532      */
   532     public String(byte bytes[], int offset, int length) {
   533     public String(byte bytes[], int offset, int length) {
   533         checkBounds(bytes, offset, length);
   534         checkBounds(bytes, offset, length);