Class DimeBodyPart


  • public class DimeBodyPart
    extends java.lang.Object
    Holds one attachment DIME part.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object data  
      protected DimeTypeNameFormat dtnf  
      protected byte[] id  
      protected static org.apache.commons.logging.Log log  
      protected byte[] type  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected DimeBodyPart()  
        DimeBodyPart​(byte[] data, DimeTypeNameFormat format, java.lang.String type, java.lang.String id)
      Create a DIME Attachment Part.
        DimeBodyPart​(javax.activation.DataHandler dh, java.lang.String id)
      Create a DIME Attachment Part.
        DimeBodyPart​(javax.activation.DataHandler dh, DimeTypeNameFormat format, java.lang.String type, java.lang.String id)
      Create a DIME Attachment Part.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long getDataSize()  
      protected long getDataSize​(javax.activation.DataHandler dh)  
      protected void sendChunk​(java.io.OutputStream os, byte position, byte[] data, byte chunk)  
      protected void sendChunk​(java.io.OutputStream os, byte position, byte[] data, int offset, int length, byte chunk)  
      protected void sendHeader​(java.io.OutputStream os, byte position, long length, byte chunk)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        protected static org.apache.commons.logging.Log log
      • data

        protected java.lang.Object data
      • type

        protected byte[] type
      • id

        protected byte[] id
    • Constructor Detail

      • DimeBodyPart

        protected DimeBodyPart()
      • DimeBodyPart

        public DimeBodyPart​(byte[] data,
                            DimeTypeNameFormat format,
                            java.lang.String type,
                            java.lang.String id)
        Create a DIME Attachment Part.
        Parameters:
        data - a byte array containing the data as the attachment.
        format - the type format for the data.
        type - the type of the data
        id - the ID for the DIME part.
      • DimeBodyPart

        public DimeBodyPart​(javax.activation.DataHandler dh,
                            DimeTypeNameFormat format,
                            java.lang.String type,
                            java.lang.String id)
        Create a DIME Attachment Part.
        Parameters:
        dh - the data for the attachment as a JAF datahadler.
        format - the type format for the data.
        type - the type of the data
        id - the ID for the DIME part.
      • DimeBodyPart

        public DimeBodyPart​(javax.activation.DataHandler dh,
                            java.lang.String id)
        Create a DIME Attachment Part.
        Parameters:
        dh - the data for the attachment as a JAF datahadler. The type and foramt is derived from the DataHandler.
        id - the ID for the DIME part.
    • Method Detail

      • sendChunk

        protected void sendChunk​(java.io.OutputStream os,
                                 byte position,
                                 byte[] data,
                                 byte chunk)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendChunk

        protected void sendChunk​(java.io.OutputStream os,
                                 byte position,
                                 byte[] data,
                                 int offset,
                                 int length,
                                 byte chunk)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendHeader

        protected void sendHeader​(java.io.OutputStream os,
                                  byte position,
                                  long length,
                                  byte chunk)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getDataSize

        protected long getDataSize()
      • getDataSize

        protected long getDataSize​(javax.activation.DataHandler dh)