Closeable, AutoCloseable, Readablepublic final class URLReader extends Reader
| Constructor | Description |
|---|---|
URLReader(URL url) |
Constructor
|
URLReader(URL url,
String charsetName) |
Constructor
|
URLReader(URL url,
Charset cs) |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the stream and releases any system resources associated with
it.
|
Charset |
getCharset() |
Charset used by this reader
|
URL |
getURL() |
URL of this reader
|
int |
read(char[] cbuf,
int off,
int len) |
Reads characters into a portion of an array.
|
public URLReader(URL url)
url - URL for this URLReaderNullPointerException - if url is nullpublic URLReader(URL url, String charsetName)
url - URL for this URLReadercharsetName - Name of the Charset used to convert bytes to charsNullPointerException - if url is nullpublic URLReader(URL url, Charset cs)
url - URL for this URLReadercs - Charset used to convert bytes to charsNullPointerException - if url is nullpublic int read(char[] cbuf,
int off,
int len)
throws IOException
java.io.Readerread in class Readercbuf - Destination bufferoff - Offset at which to start storing characterslen - Maximum number of characters to readIOException - If an I/O error occurspublic void close()
throws IOException
java.io.Readerclose in interface AutoCloseableclose in interface Closeableclose in class ReaderIOException - If an I/O error occurspublic URL getURL()
public Charset getCharset()
Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 2014, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Debian+0-9b153-2