|
Restlet Framework 2.2.2 Google Web Toolkit |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.client.engine.io.IoUtils
public class IoUtils
IO manipulation utilities.
Field Summary | |
---|---|
static int |
BUFFER_SIZE
The size to use when instantiating buffered items such as instances of the BufferedReader class. |
static int |
TIMEOUT_MS
The number of milliseconds after which IO operation will time out. |
Method Summary | |
---|---|
static long |
getAvailableSize(Representation representation)
Returns the size effectively available. |
static Reader |
getReader(InputStream stream,
CharacterSet characterSet)
Returns a reader from an input stream and a character set. |
static String |
toString(InputStream inputStream)
Converts an input stream to a string. As this method uses the InputstreamReader class, the default character set is used for decoding the input stream. |
static String |
toString(InputStream inputStream,
CharacterSet characterSet)
Converts an input stream to a string using the specified character set for decoding the input stream. |
static String |
toString(Reader reader)
Converts a reader to a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFER_SIZE
BufferedReader
class. It looks for the System property
"org.restlet.client.engine.io.bufferSize" and if not defined, uses the "8192"
default value.
public static final int TIMEOUT_MS
Method Detail |
---|
public static long getAvailableSize(Representation representation)
Representation.getSize()
if no range is defined, otherwise it
returns the size of the range using Range.getSize()
.
representation
- The representation to evaluate.
public static Reader getReader(InputStream stream, CharacterSet characterSet) throws UnsupportedEncodingException
stream
- The input stream.characterSet
- The character set. May be null.
UnsupportedEncodingException
- if a character set is given, but not supportedpublic static String toString(InputStream inputStream)
inputStream
- The input stream.
InputStreamReader
,
toString(InputStream, CharacterSet)
public static String toString(InputStream inputStream, CharacterSet characterSet)
inputStream
- The input stream.characterSet
- The character set
InputStreamReader
public static String toString(Reader reader)
reader
- The characters reader.
InputStreamReader
|
Restlet Framework 2.2.2 Google Web Toolkit |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |