Efficiently prepends this instance with another HttpData
instance to possibly
form a compound instance.
Efficiently prepends this instance with another HttpData
instance to possibly
form a compound instance. No data need to be copied around to do this.
Extracts span
bytes from this instance starting at sourceOffset
and copies
them to the xs
starting at targetOffset
.
Extracts span
bytes from this instance starting at sourceOffset
and copies
them to the xs
starting at targetOffset
. If span
is larger than the number
of bytes available in this instance after the sourceOffset
or if xs
has
less space available after targetOffset
the number of bytes copied is
decreased accordingly (i.e. it is not an error to specify a span
that is
too large).
Returns the number of bytes contained in this instance.
Returns a slice of this instance as an HttpData
.
Returns a slice of this instance's content as a ByteString
.
Returns a slice of this instance's content as a ByteString
.
CAUTION: Since this instance might point to bytes contained in an off-memory file this method might cause the loading of a large amount of data into the JVM heap (up to 2 GB!).
Copies the contents of this instance into a new byte array.
Copies the contents of this instance into a new byte array.
CAUTION: Since this instance might point to bytes contained in an off-memory file
this method might cause the loading of a large amount of data into the JVM
heap (up to 2 GB!).
If this instance is a FileBytes
instance containing more than 2GB of data
the method will throw an IllegalArgumentException
.
Same as toByteArray
but returning a ByteString
instead.
Same as toByteArray
but returning a ByteString
instead.
More efficient if this instance is a Bytes
instance since no data will have
to be copied and the ByteString
will not have to be newly created.
CAUTION: Since this instance might point to bytes contained in an off-memory file
this method might cause the loading of a large amount of data into the JVM
heap (up to 2 GB!).
If this instance is a FileBytes
instance containing more than 2GB of data
the method will throw an IllegalArgumentException
.
Returns the contents of this instance as a Stream[HttpData]
with each
chunk not being larger than the given maxChunkSize
.
Returns the contents of this instance as a string.
Returns the contents of this instance as a string.
CAUTION: Since this instance might point to bytes contained in an off-memory file
this method might cause the loading of a large amount of data into the JVM
heap (up to 2 GB!).
If this instance is a FileBytes
instance containing more than 2GB of data
the method will throw an IllegalArgumentException
.
Returns the contents of this instance as a string.
Returns the contents of this instance as a string.
CAUTION: Since this instance might point to bytes contained in an off-memory file
this method might cause the loading of a large amount of data into the JVM
heap (up to 2 GB!).
If this instance is a FileBytes
instance containing more than 2GB of data
the method will throw an IllegalArgumentException
.
Returns the contents of this instance as a string (using UTF-8 encoding).
Returns the contents of this instance as a string (using UTF-8 encoding).
CAUTION: Since this instance might point to bytes contained in an off-memory file
this method might cause the loading of a large amount of data into the JVM
heap (up to 2 GB!).
If this instance is a FileBytes
instance containing more than 2GB of data
the method will throw an IllegalArgumentException
.
Determines whether this instance is or contains data that are not already present in the JVM heap (i.e.
Determines whether this instance is or contains data that are not already present in the JVM heap (i.e. instance of HttpData.FileBytes).
Determines whether this instance is identical to HttpData.Empty.
Determines whether this instance is different from HttpData.Empty.