code: public static final IDataSegment create (final DataSegmentFormat format, final int maxChunkSize) {
  
          final IDataSegment dataSegment;
          switch (format) {
              case TEXT :
                  dataSegment = new TextParameterDataSegment(maxChunkSize);
                  break;
  
              case BINARY :
                  dataSegment = new BinaryDataSegment(maxChunkSize);
                  break;
  
              case NONE :
                  dataSegment = new NullDataSegment(maxChunkSize);
                  break;
  
              default :
                  throw new IllegalArgumentException("Unknown data segment format.");
          }
  
          return dataSegment;
      }
docs: Creates a data segment of the given format and with the given chunk size (in bytes).
  
  @param format A format from the <code>DataSegmentFormat</code> enumeration.
  @param maxChunkSize The size (in bytes) of one chunk, which represents the <code>MaxRecvDataSegmentLength</code>
  .
  @return The instance of an <codE>DataSegment</code> object.