|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.core.provider.AbstractMessageReaderWriterProvider<T>
public abstract class AbstractMessageReaderWriterProvider<T>
Field Summary | |
---|---|
static Charset |
UTF8
The UTF-8 Charset. |
Constructor Summary | |
---|---|
AbstractMessageReaderWriterProvider()
|
Method Summary | |
---|---|
static Charset |
getCharset(javax.ws.rs.core.MediaType m)
Get the character set from a media type. |
long |
getSize(T t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
|
static String |
readFromAsString(InputStream in,
javax.ws.rs.core.MediaType type)
Read the bytes of an input stream and convert to a string. |
static void |
writeTo(InputStream in,
OutputStream out)
Reader bytes from an input stream and write then to an output stream. |
static void |
writeTo(Reader in,
Writer out)
Reader characters from an input stream and write then to an output stream. |
static void |
writeToAsString(String s,
OutputStream out,
javax.ws.rs.core.MediaType type)
Convert a string to bytes and write those bytes to an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.ws.rs.ext.MessageBodyReader |
---|
isReadable, readFrom |
Methods inherited from interface javax.ws.rs.ext.MessageBodyWriter |
---|
isWriteable, writeTo |
Field Detail |
---|
public static final Charset UTF8
Constructor Detail |
---|
public AbstractMessageReaderWriterProvider()
Method Detail |
---|
public static final void writeTo(InputStream in, OutputStream out) throws IOException
in
- the input stream to read from.out
- the output stream to write to.
IOException
- if there is an error reading or writing bytes.public static final void writeTo(Reader in, Writer out) throws IOException
in
- the reader to read from.out
- the writer to write to.
IOException
- if there is an error reading or writing characters.public static final Charset getCharset(javax.ws.rs.core.MediaType m)
The character set is obtained from the media type parameter "charset".
If the parameter is not present the UTF8
charset is utilized.
m
- the media type.
public static final String readFromAsString(InputStream in, javax.ws.rs.core.MediaType type) throws IOException
in
- the input stream to read from.type
- the media type that determines the character set defining
how to decode bytes to charaters.
IOException
- if there is an error reading from the input stream.public static final void writeToAsString(String s, OutputStream out, javax.ws.rs.core.MediaType type) throws IOException
s
- the string to convert to bytes.out
- the output stream to write to.type
- the media type that determines the character set defining
how to decode bytes to characters.
IOException
public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |