de.vxart.net
Class MultipartMessage.Part

java.lang.Object
  extended by de.vxart.net.MultipartMessage.Part
Enclosing class:
MultipartMessage

public class MultipartMessage.Part
extends java.lang.Object


Constructor Summary
MultipartMessage.Part(java.util.Map<java.lang.String,java.lang.String> headers, java.io.DataInputStream input, long size)
          Constructs a new Part with the specified headers and InputStream as data source.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getHeaders()
          Returns all headers associated with this part.
 java.io.InputStream openStream()
          Provides a stream containing the data of this part.
 boolean skip()
          Skips over the data of this Part.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipartMessage.Part

public MultipartMessage.Part(java.util.Map<java.lang.String,java.lang.String> headers,
                             java.io.DataInputStream input,
                             long size)
Constructs a new Part with the specified headers and InputStream as data source. The InputStream will be wrapped into another stream that prevents reading more bytes than specified by the limit.

Parameters:
headers - the multipart headers for this Part
input - the InputStream from which this Part is fed
size - the size of the data payload
Method Detail

skip

public boolean skip()
Skips over the data of this Part. Calling this method more than once does not have any effect.

Returns:
true if any actually data has been skipped, false otherwise

openStream

public java.io.InputStream openStream()
Provides a stream containing the data of this part.

Returns:
a stream containing the data of this part

getHeaders

public java.util.Map<java.lang.String,java.lang.String> getHeaders()
Returns all headers associated with this part.

Returns:
all headers associated with this part