public interface HttpData extends InterfaceHttpData, ByteBufHolder
InterfaceHttpData.HttpDataType
限定符和类型 | 方法和说明 |
---|---|
void |
addContent(ByteBuf buffer,
boolean last)
Add the content from the ChannelBuffer
ReferenceCounted.release() ownership of buffer is transferred to this HttpData . |
void |
checkSize(long newSize)
Check if the new size is not reaching the max limit allowed.
|
HttpData |
copy()
Creates a deep copy of this
ByteBufHolder . |
long |
definedLength()
Returns the defined length of the HttpData.
|
void |
delete()
Deletes the underlying storage for a file item, including deleting any
associated temporary disk file.
|
HttpData |
duplicate()
Duplicates this
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() |
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
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 |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content . |
HttpData |
retain()
Increases the reference count by
1 . |
HttpData |
retain(int increment)
Increases the reference count by the specified
increment . |
HttpData |
retainedDuplicate()
Duplicates this
ByteBufHolder . |
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)
ReferenceCounted.release() ownership of buffer is transferred to this HttpData . |
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)
|
void |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
HttpData |
touch()
Records the current access location of this object for debugging purposes.
|
HttpData |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
getHttpDataType, getName
content
refCnt, release, release
long getMaxSize()
void setMaxSize(long maxSize)
void checkSize(long newSize) throws java.io.IOException
java.io.IOException
void setContent(ByteBuf buffer) throws java.io.IOException
ReferenceCounted.release()
ownership of buffer
is transferred to this HttpData
.
buffer
- must be not nulljava.io.IOException
void addContent(ByteBuf buffer, boolean last) throws java.io.IOException
ReferenceCounted.release()
ownership of buffer
is transferred to this HttpData
.
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()
long definedLength()
FileUpload
or any known big Attribute
.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 retainedDuplicate()
ByteBufHolder
ByteBufHolder
. This method returns a retained duplicate unlike ByteBufHolder.duplicate()
.retainedDuplicate
在接口中 ByteBufHolder
ByteBuf.retainedDuplicate()
HttpData replace(ByteBuf content)
ByteBufHolder
ByteBufHolder
which contains the specified content
.replace
在接口中 ByteBufHolder
HttpData retain()
ReferenceCounted
1
.retain
在接口中 ByteBufHolder
retain
在接口中 InterfaceHttpData
retain
在接口中 ReferenceCounted
HttpData retain(int increment)
ReferenceCounted
increment
.retain
在接口中 ByteBufHolder
retain
在接口中 InterfaceHttpData
retain
在接口中 ReferenceCounted
HttpData touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
在接口中 ByteBufHolder
touch
在接口中 InterfaceHttpData
touch
在接口中 ReferenceCounted
HttpData touch(java.lang.Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
在接口中 ByteBufHolder
touch
在接口中 InterfaceHttpData
touch
在接口中 ReferenceCounted