|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.ByteUtils
public final class ByteUtils
Byte manipulation utilities.
Method Summary | |
---|---|
static ReadableByteChannel |
getChannel(InputStream inputStream)
Returns a readable byte channel based on a given inputstream. |
static WritableByteChannel |
getChannel(OutputStream outputStream)
Returns a writable byte channel based on a given output stream. |
static ReadableByteChannel |
getChannel(Representation representation)
Returns a readable byte channel based on the given representation's content and its write(WritableByteChannel) method. |
static InputStream |
getStream(ReadableByteChannel readableChannel)
Returns an input stream based on a given readable byte channel. |
static InputStream |
getStream(Representation representation)
Returns an input stream based on the given representation's content and its write(OutputStream) method. |
static OutputStream |
getStream(WritableByteChannel writableChannel)
Returns an output stream based on a given writable byte channel. |
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 void |
write(InputStream inputStream,
OutputStream outputStream)
Writes an input stream to an output stream. |
static void |
write(ReadableByteChannel readableChannel,
WritableByteChannel writableChannel)
Writes a readable channel to a writable channel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ReadableByteChannel getChannel(InputStream inputStream) throws IOException
inputStream
- The input stream to convert.
IOException
public static WritableByteChannel getChannel(OutputStream outputStream) throws IOException
outputStream
- The output stream.
IOException
public static ReadableByteChannel getChannel(Representation representation) throws IOException
IOException
public static InputStream getStream(ReadableByteChannel readableChannel) throws IOException
readableChannel
- The readable byte channel.
IOException
public static InputStream getStream(Representation representation) throws IOException
IOException
public static OutputStream getStream(WritableByteChannel writableChannel)
writableChannel
- The writable byte channel.
public static String toString(InputStream inputStream)
inputStream
- The input stream.
toString(InputStream, CharacterSet)
public static String toString(InputStream inputStream, CharacterSet characterSet)
inputStream
- The input stream.characterSet
- The character set
public static void write(InputStream inputStream, OutputStream outputStream) throws IOException
inputStream
- The input stream.outputStream
- The output stream.
IOException
public static void write(ReadableByteChannel readableChannel, WritableByteChannel writableChannel) throws IOException
readableChannel
- The readable channel.writableChannel
- The writable channel.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |