@@ -1594,10 +1594,9 @@ public static int length(final Object[] array) {
15941594 * @param charset the charset to use, null means platform default
15951595 * @return an Iterator of the lines in the reader, never null
15961596 * @throws IllegalArgumentException if the input is null
1597- * @throws IOException Never thrown.
15981597 * @since 2.3
15991598 */
1600- public static LineIterator lineIterator (final InputStream input , final Charset charset ) throws IOException {
1599+ public static LineIterator lineIterator (final InputStream input , final Charset charset ) {
16011600 return new LineIterator (new InputStreamReader (input , Charsets .toCharset (charset )));
16021601 }
16031602
@@ -1628,13 +1627,12 @@ public static LineIterator lineIterator(final InputStream input, final Charset c
16281627 * @param charsetName the encoding to use, null means platform default
16291628 * @return an Iterator of the lines in the reader, never null
16301629 * @throws IllegalArgumentException if the input is null
1631- * @throws IOException if an I/O error occurs, such as if the encoding is invalid
16321630 * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
16331631 * .UnsupportedEncodingException} in version 2.2 if the
16341632 * encoding is not supported.
16351633 * @since 1.2
16361634 */
1637- public static LineIterator lineIterator (final InputStream input , final String charsetName ) throws IOException {
1635+ public static LineIterator lineIterator (final InputStream input , final String charsetName ) {
16381636 return lineIterator (input , Charsets .toCharset (charsetName ));
16391637 }
16401638
@@ -2543,11 +2541,10 @@ public static byte[] toByteArray(final Reader reader, final String charsetName)
25432541 * @param input the {@code String} to convert
25442542 * @return the requested byte array
25452543 * @throws NullPointerException if the input is null
2546- * @throws IOException Never thrown.
25472544 * @deprecated 2.5 Use {@link String#getBytes()} instead
25482545 */
25492546 @ Deprecated
2550- public static byte [] toByteArray (final String input ) throws IOException {
2547+ public static byte [] toByteArray (final String input ) {
25512548 // make explicit the use of the default charset
25522549 return input .getBytes (Charset .defaultCharset ());
25532550 }
@@ -2717,13 +2714,12 @@ public static InputStream toInputStream(final CharSequence input, final Charset
27172714 * @param input the CharSequence to convert
27182715 * @param charsetName the name of the requested charset, null means platform default
27192716 * @return an input stream
2720- * @throws IOException Never thrown.
27212717 * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
27222718 * .UnsupportedEncodingException} in version 2.2 if the
27232719 * encoding is not supported.
27242720 * @since 2.0
27252721 */
2726- public static InputStream toInputStream (final CharSequence input , final String charsetName ) throws IOException {
2722+ public static InputStream toInputStream (final CharSequence input , final String charsetName ) {
27272723 return toInputStream (input , Charsets .toCharset (charsetName ));
27282724 }
27292725
@@ -2764,13 +2760,12 @@ public static InputStream toInputStream(final String input, final Charset charse
27642760 * @param input the string to convert
27652761 * @param charsetName the name of the requested charset, null means platform default
27662762 * @return an input stream
2767- * @throws IOException Never thrown.
27682763 * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
27692764 * .UnsupportedEncodingException} in version 2.2 if the
27702765 * encoding is not supported.
27712766 * @since 1.1
27722767 */
2773- public static InputStream toInputStream (final String input , final String charsetName ) throws IOException {
2768+ public static InputStream toInputStream (final String input , final String charsetName ) {
27742769 final byte [] bytes = input .getBytes (Charsets .toCharset (charsetName ));
27752770 return new ByteArrayInputStream (bytes );
27762771 }
@@ -2782,11 +2777,10 @@ public static InputStream toInputStream(final String input, final String charset
27822777 * @param input the byte array to read from
27832778 * @return the requested String
27842779 * @throws NullPointerException if the input is null
2785- * @throws IOException Never thrown.
27862780 * @deprecated 2.5 Use {@link String#String(byte[])} instead
27872781 */
27882782 @ Deprecated
2789- public static String toString (final byte [] input ) throws IOException {
2783+ public static String toString (final byte [] input ) {
27902784 // make explicit the use of the default charset
27912785 return new String (input , Charset .defaultCharset ());
27922786 }
@@ -2802,9 +2796,8 @@ public static String toString(final byte[] input) throws IOException {
28022796 * @param charsetName the name of the requested charset, null means platform default
28032797 * @return the requested String
28042798 * @throws NullPointerException if the input is null
2805- * @throws IOException Never thrown.
28062799 */
2807- public static String toString (final byte [] input , final String charsetName ) throws IOException {
2800+ public static String toString (final byte [] input , final String charsetName ) {
28082801 return new String (input , Charsets .toCharset (charsetName ));
28092802 }
28102803
0 commit comments