|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.msgframing.MessagePackageHeader
public class MessagePackageHeader
Header Package for Messages. Analagous to HTTP Headers.
Nested Class Summary | |
---|---|
static class |
MessagePackageHeader.Header
Used for storing headers. |
Field Summary | |
---|---|
(package private) List |
headers
|
Constructor Summary | |
---|---|
MessagePackageHeader()
Creates a new instance of MessagePackage. |
|
MessagePackageHeader(InputStream in)
Creates a new instance of MessagePackage. |
Method Summary | |
---|---|
void |
addHeader(String name,
byte[] value)
Add a header. |
long |
getContentLengthHeader()
Convenience Method for Content Length header |
MimeMediaType |
getContentTypeHeader()
Convenience Method for Content Type header |
Iterator |
getHeader(String name)
Gets all of the headers matching the specified name |
Iterator |
getHeaders()
Gets all of the headers |
void |
replaceHeader(String name,
byte[] value)
Replace a header. |
void |
sendToStream(OutputStream out)
Write the headers to a stream |
void |
setContentLengthHeader(long length)
Convenience Method for Content Length header |
void |
setContentTypeHeader(MimeMediaType type)
Convenience Method for Content Type header |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
List headers
Constructor Detail |
---|
public MessagePackageHeader()
public MessagePackageHeader(InputStream in) throws IOException
in
- the stream from which the headers will be read.
IOException
Method Detail |
---|
public void addHeader(String name, byte[] value)
name
- the header namevalue
- the value for the headerpublic void replaceHeader(String name, byte[] value)
name
- the header namevalue
- the value for the headerpublic Iterator getHeaders()
public Iterator getHeader(String name)
name
- the name of the header we are seeking.public void sendToStream(OutputStream out) throws IOException
out
- the stream to send the headers to.
IOException
public void setContentLengthHeader(long length)
length
- length of the message.public long getContentLengthHeader()
public void setContentTypeHeader(MimeMediaType type)
type
- type of the message.public MimeMediaType getContentTypeHeader()
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |