|
||||||||||
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.StringOutputDataStream
StringOutputDataStream
represents a BEEP message's
payload. Allows implementors to treat a String
as a
DataSream
. The String
is stored as a
byte[]
using UTF-8 encoding.
Note that this
implementation is not synchronized. If multiple threads access
a StringOutputDataStream
concurrently, data may be
inconsistent or lost.
OutputDataStream
Field Summary |
Fields inherited from class org.beepcore.beep.core.OutputDataStream |
mimeHeaders |
Constructor Summary | |
StringOutputDataStream(java.lang.String data)
Creates a StringOutputDataStream with a
String and a BEEP_XML_CONTENT_TYPE
content type and a transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
StringOutputDataStream(java.lang.String contentType,
java.lang.String data)
Creates a StringOutputDataStream with a
String and a specified content type and a transfer
encoding of DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
StringOutputDataStream(java.lang.String contentType,
java.lang.String transferEncoding,
java.lang.String data)
Creates a StringOutputDataStream with a
String and a specified content type and a transfer
encoding of DEFAULT_CONTENT_TRANSFER_ENCODING . |
|
StringOutputDataStream(java.lang.String contentType,
java.lang.String transferEncoding,
java.lang.String data,
java.lang.String enc)
Creates a StringOutputDataStream with a
String and a specified content type and encoding. |
Method Summary | |
java.lang.String |
getContentType()
Returns the value of the MIME entity header Content-Type . |
java.lang.String |
getEncoding()
Returns the encoding used to convert the String to a
bytes[] . |
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 StringOutputDataStream(java.lang.String data)
StringOutputDataStream
with a
String
and a BEEP_XML_CONTENT_TYPE
content type and a transfer encoding of
DEFAULT_CONTENT_TRANSFER_ENCODING
.
data
- A String
representing a message's payload.public StringOutputDataStream(java.lang.String contentType, java.lang.String data)
StringOutputDataStream
with a
String
and a specified content type and a transfer
encoding of DEFAULT_CONTENT_TRANSFER_ENCODING
.
contentType
- Content type of data
data
- A String
representing a message's payload.public StringOutputDataStream(java.lang.String contentType, java.lang.String transferEncoding, java.lang.String data)
StringOutputDataStream
with a
String
and a specified content type and a transfer
encoding of DEFAULT_CONTENT_TRANSFER_ENCODING
.
contentType
- Content type of data
transferEncoding
- Encoding Transfer encoding type of
data
.data
- A String
representing a message's payload.public StringOutputDataStream(java.lang.String contentType, java.lang.String transferEncoding, java.lang.String data, java.lang.String enc) throws java.io.UnsupportedEncodingException
StringOutputDataStream
with a
String
and a specified content type and encoding.
contentType
- Content type of data
transferEncoding
- Encoding Transfer encoding type of
data
.data
- A String
representing a message's payload.enc
- The encoding used when converting data
to a
bytes[]
.Method Detail |
public java.lang.String getEncoding()
String
to a
bytes[]
.
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.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 java.lang.String getTransferEncoding() throws BEEPException
Content-Transfer-Encoding
.
BEEPException
public void setTransferEncoding(java.lang.String transferEncoding)
DataStream
transferEncoding
- 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 |