Package com.linecorp.armeria.common
Class DefaultHttpData
- java.lang.Object
-
- com.linecorp.armeria.common.AbstractHttpData
-
- com.linecorp.armeria.common.DefaultHttpData
-
- All Implemented Interfaces:
HttpData
,HttpObject
public final class DefaultHttpData extends AbstractHttpData
DefaultHttpData
implementation.
-
-
Field Summary
-
Fields inherited from interface com.linecorp.armeria.common.HttpData
EMPTY_DATA
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpData(byte[] data, boolean endOfStream)
Creates a new instance.
-
Method Summary
Modifier and Type Method Description byte[]
array()
Returns the underlying byte array of this data.protected byte
getByte(int index)
Gets thebyte
value at the givenindex
.boolean
isEndOfStream()
Tells whether the stream should be ended when writing this object.int
length()
Returns the length of this data.String
toString()
-
Methods inherited from class com.linecorp.armeria.common.AbstractHttpData
equals, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.linecorp.armeria.common.HttpData
isEmpty, offset, toInputStream, toReader, toReaderAscii, toReaderUtf8, toString, toStringAscii, toStringUtf8
-
-
-
-
Method Detail
-
array
public byte[] array()
Description copied from interface:HttpData
Returns the underlying byte array of this data.
-
length
public int length()
Description copied from interface:HttpData
Returns the length of this data.
-
isEndOfStream
public boolean isEndOfStream()
Description copied from interface:HttpObject
Tells whether the stream should be ended when writing this object. This can be useful forHttpHeaders
-only responses or to more efficiently close the stream along with the last piece ofHttpData
. This only has meaning forHttpObject
writers, not readers.
-
getByte
protected byte getByte(int index)
Description copied from class:AbstractHttpData
Gets thebyte
value at the givenindex
.- Specified by:
getByte
in classAbstractHttpData
-
-