public interface HttpData extends InterfaceHttpData, ByteBufHolder
InterfaceHttpData.HttpDataType
限定符和类型 | 方法和说明 |
---|---|
void |
addContent(ByteBuf buffer,
boolean last)
Add the content from the ChannelBuffer
|
HttpData |
copy()
Create a deep copy of this
ByteBufHolder . |
void |
delete()
Deletes the underlying storage for a file item, including deleting any
associated temporary disk file.
|
HttpData |
duplicate()
Duplicate the
ByteBufHolder . |
byte[] |
get()
Returns the contents of the file item as an array of bytes.
|
ByteBuf |
getByteBuf()
Returns the content of the file item as a ByteBuf
|
java.nio.charset.Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined.
|
ByteBuf |
getChunk(int length)
Returns a ChannelBuffer for the content from the current position with at
most length read bytes, increasing the current position of the Bytes
read.
|
java.io.File |
getFile() |
java.lang.String |
getString()
Returns the contents of the file item as a String, using the default
character encoding.
|
java.lang.String |
getString(java.nio.charset.Charset encoding)
Returns the contents of the file item as a String, using the specified
charset.
|
boolean |
isCompleted() |
boolean |
isInMemory()
Provides a hint as to whether or not the file contents will be read from
memory.
|
long |
length()
Returns the size in byte of the InterfaceHttpData
|
boolean |
renameTo(java.io.File dest)
A convenience getMethod to write an uploaded item to disk.
|
HttpData |
retain()
Increases the reference count by
1 . |
HttpData |
retain(int increment)
Increases the reference count by the specified
increment . |
void |
setCharset(java.nio.charset.Charset charset)
Set the Charset passed by the browser if defined
|
void |
setContent(ByteBuf buffer)
Set the content from the ChannelBuffer (erase any previous data)
|
void |
setContent(java.io.File file)
Set the content from the file (erase any previous data)
|
void |
setContent(java.io.InputStream inputStream)
Set the content from the inputStream (erase any previous data)
|
getHttpDataType, getName
content
refCnt, release, release
void setContent(ByteBuf buffer) throws java.io.IOException
buffer
- must be not nulljava.io.IOException
void addContent(ByteBuf buffer, boolean last) throws java.io.IOException
buffer
- must be not null except if last is set to Falselast
- True of the buffer is the last onejava.io.IOException
void setContent(java.io.File file) throws java.io.IOException
file
- must be not nulljava.io.IOException
void setContent(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- must be not nulljava.io.IOException
boolean isCompleted()
long length()
void delete()
byte[] get() throws java.io.IOException
java.io.IOException
ByteBuf getByteBuf() throws java.io.IOException
java.io.IOException
ByteBuf getChunk(int length) throws java.io.IOException
java.io.IOException
java.lang.String getString() throws java.io.IOException
java.io.IOException
java.lang.String getString(java.nio.charset.Charset encoding) throws java.io.IOException
encoding
- the charset to usejava.io.IOException
void setCharset(java.nio.charset.Charset charset)
charset
- Charset to set - must be not nulljava.nio.charset.Charset getCharset()
boolean renameTo(java.io.File dest) throws java.io.IOException
dest
- destination file - must be not nulljava.io.IOException
boolean isInMemory()
java.io.File getFile() throws java.io.IOException
java.io.IOException
- if this data is not represented by a fileHttpData copy()
ByteBufHolder
ByteBufHolder
.copy
在接口中 ByteBufHolder
HttpData duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.duplicate
在接口中 ByteBufHolder
HttpData retain()
ReferenceCounted
1
.retain
在接口中 ByteBufHolder
retain
在接口中 ReferenceCounted
HttpData retain(int increment)
ReferenceCounted
increment
.retain
在接口中 ByteBufHolder
retain
在接口中 ReferenceCounted