|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.beepcore.beep.core.OutputDataStream | +--org.beepcore.beep.core.ByteOutputDataStream
ByteOutputDataStream
represents a BEEP message's
payload. Allows the implementor to treat a byte[]
as
a DataStream
.
Note that this implementation is
not synchronized. If multiple threads access a
ByteOutputDataStream
concurrently, data may be
inconsistent or lost.
OutputDataStream
Field Summary |
Fields inherited from class org.beepcore.beep.core.OutputDataStream |
mimeHeaders |
Constructor Summary | |
ByteOutputDataStream(byte[] data)
Creates a ByteOutputDataStream from a
byte[] with a content type of
DEFAULT_CONTENT_TYPE and a transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
ByteOutputDataStream(byte[] data,
int offset,
int length)
Creates a ByteOutputDataStream from a
byte[] using the specified length and offset with
a content type of DEFAULT_CONTENT_TYPE and a
transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
ByteOutputDataStream(java.lang.String contentType,
byte[] data)
Creates a ByteOutputDataStream from a byte[]
with a specified content type and a transfer encoding
of DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
ByteOutputDataStream(java.lang.String contentType,
byte[] data,
int offset,
int length)
Creates a ByteOutputDataStream from a
byte[] using the specified length and offset and
with a specified content type and a transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
ByteOutputDataStream(java.lang.String contentType,
java.lang.String transferEncoding,
byte[] data)
Creates a ByteOutputDataStream from a byte[]
with a specified content type and a specified transfer encoding. |
|
ByteOutputDataStream(java.lang.String contentType,
java.lang.String transferEncoding,
byte[] data,
int offset,
int length)
Creates a ByteOutputDataStream from a
byte[] using the specified length and offset and
with a specified content type and a specified transfer
encoding. |
Method Summary | |
java.lang.String |
getContentType()
Returns the value of the MIME entity header Content-Type . |
java.util.Enumeration |
getHeaderNames()
Returns an Enumeration of all the names of the MIME entity
headers in this data stream.
|
java.lang.String |
getHeaderValue(java.lang.String name)
Retrieves the correspoding value to a given a MIME entity
header name . |
java.lang.String |
getTransferEncoding()
Returns the value of the MIME entity header Content-Transfer-Encoding . |
boolean |
isComplete()
Returns true if no more bytes will be added to those
currently available, if any, on this stream. |
boolean |
removeHeader(java.lang.String name)
Removes the name and value of a MIME entity
header from the data stream. |
void |
setContentType(java.lang.String contentType)
Sets the content type of a DataStream . |
void |
setHeaderValue(java.lang.String name,
java.lang.String value)
Adds a MIME entity header to this data stream. |
void |
setTransferEncoding(java.lang.String transferEncoding)
Sets the content transfer encoding of a DataStream |
Methods inherited from class org.beepcore.beep.core.OutputDataStream |
add, close, setComplete |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ByteOutputDataStream(byte[] data)
ByteOutputDataStream
from a
byte[]
with a content type of
DEFAULT_CONTENT_TYPE
and a transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING
.
data
- A byte[]
representing a message's payload.public ByteOutputDataStream(java.lang.String contentType, byte[] data)
ByteOutputDataStream
from a byte[]
with a specified content type and a transfer encoding
of DEFAULT_CONTENT_TRANSFER_ENCODING
.
contentType
- Content type of data
.data
- A byte[]
representing a message's payload.public ByteOutputDataStream(java.lang.String contentType, java.lang.String transferEncoding, byte[] data)
ByteOutputDataStream
from a byte[]
with a specified content type and a specified transfer encoding.
contentType
- Content type of data
.transferEncoding
- Encoding Transfer encoding type of
data
.data
- A byte[]
representing a message's payload.public ByteOutputDataStream(byte[] data, int offset, int length)
ByteOutputDataStream
from a
byte[]
using the specified length and offset with
a content type of DEFAULT_CONTENT_TYPE
and a
transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING
.
data
- A byte[]
representing a message's payload.offset
- The start offset in array data
at which the
data is written.length
- The maximum number of bytes to read.public ByteOutputDataStream(java.lang.String contentType, byte[] data, int offset, int length)
ByteOutputDataStream
from a
byte[]
using the specified length and offset and
with a specified content type and a transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING
.
contentType
- Content type of byte[]
.data
- A byte[]
representing a message's payload.offset
- The start offset in array data
at which the
data is written.length
- The maximum number of bytes to read.public ByteOutputDataStream(java.lang.String contentType, java.lang.String transferEncoding, byte[] data, int offset, int length)
ByteOutputDataStream
from a
byte[]
using the specified length and offset and
with a specified content type and a specified transfer
encoding.
contentType
- Content type of byte[]
.transferEncoding
- Encoding Transfer encoding type of
data
.data
- A byte[]
representing a message's payload.offset
- The start offset in array data
at which the
data is written.length
- The maximum number of bytes to read.Method Detail |
public boolean isComplete()
true
if no more bytes will be added to those
currently available, if any, on this stream. Returns
false
if more bytes are expected.
isComplete
in class OutputDataStream
public java.lang.String getContentType() throws BEEPException
Content-Type
.
BEEPException
public void setContentType(java.lang.String contentType)
DataStream
.
contentType
- public java.lang.String getTransferEncoding() throws BEEPException
Content-Transfer-Encoding
.
BEEPException
public void setTransferEncoding(java.lang.String transferEncoding)
DataStream
transferEncoding
- public java.util.Enumeration getHeaderNames() throws BEEPException
Enumeration
of all the names of the MIME entity
headers in this data stream.
Use this call in conjunction with getHeaderValue
to iterate
through all the corresponding MIME entity header value
(s)
in this data stream.
Enumeration
of all the MIME entity header
names.
BEEPException
public java.lang.String getHeaderValue(java.lang.String name) throws BEEPException
value
to a given a MIME entity
header name
.
name
- Name of the MIME entity header.
value
of the MIME entity header.
BEEPException
public void setHeaderValue(java.lang.String name, java.lang.String value)
name
- Name of the MIME enitity header.value
- Value of the MIME entity header.public boolean removeHeader(java.lang.String name)
name
and value
of a MIME entity
header from the data stream. Returns true
if the
name
was successfully removed.
name
- Name of the header to be removed from the data stream.
if header was removed. Otherwise,
returns false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |