Package com.sk89q.worldedit.util.net
Class HttpRequest.BufferedResponse
java.lang.Object
com.sk89q.worldedit.util.net.HttpRequest.BufferedResponse
- Enclosing class:
HttpRequest
Used to buffer the response in memory.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]asBytes()Return the result as bytes.Return the result as a string.saveContent(File file) Save the result to a file.saveContent(OutputStream out) Save the result to an output stream.
-
Method Details
-
asBytes
public byte[] asBytes()Return the result as bytes.- Returns:
- the data
-
asString
Return the result as a string.- Parameters:
encoding- the encoding- Returns:
- the string
- Throws:
IOException- on I/O error
-
saveContent
Save the result to a file.- Parameters:
file- the file- Returns:
- this object
- Throws:
IOException- on I/O errorInterruptedException- on interruption
-
saveContent
public HttpRequest.BufferedResponse saveContent(OutputStream out) throws IOException, InterruptedException Save the result to an output stream.- Parameters:
out- the output stream- Returns:
- this object
- Throws:
IOException- on I/O errorInterruptedException- on interruption
-