|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.http.client.FileBodyGenerator.FileBody
protected static class FileBodyGenerator.FileBody
| Constructor Summary | |
|---|---|
FileBodyGenerator.FileBody(java.io.File file)
|
|
| Method Summary | |
|---|---|
void |
close()
Releases any resources associated with this body. |
long |
getContentLength()
Gets the length of the body. |
long |
read(java.nio.ByteBuffer buffer)
Reads the next chunk of bytes from the body. |
long |
transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target)
Transfers the specified chunk of bytes from this body to the specified channel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileBodyGenerator.FileBody(java.io.File file)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public long getContentLength()
Body
getContentLength in interface Body
public long read(java.nio.ByteBuffer buffer)
throws java.io.IOException
Body
read in interface Bodybuffer - The buffer to store the chunk in, must not be null.
-1 if the body has been read completely.
java.io.IOException - If the chunk could not be read.
public long transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target)
throws java.io.IOException
RandomAccessBody
transferTo in interface RandomAccessBodyposition - The zero-based byte index from which to start the transfer, must not be negative.count - The maximum number of bytes to transfer, must not be negative.target - The destination channel to transfer the body chunk to, must not be null.
java.io.IOException - If the body chunk could not be transferred.
public void close()
throws java.io.IOException
Body
close in interface Bodyjava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||