Class: XDS::XdsPart
- Inherits:
-
Object
- Object
- XDS::XdsPart
- Defined in:
- lib/xds/xds_part.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
- #length ⇒ Object
-
#send(out) ⇒ Object
/*** 298 * Write all the data to the output stream.
- #send_id(out) ⇒ Object
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/xds/xds_part.rb', line 7 def id @id end |
Instance Method Details
#length ⇒ Object
9 10 11 |
# File 'lib/xds/xds_part.rb', line 9 def length super + XDS::CRLF_BYTES.length + org.apache.commons.httpclient.util.EncodingUtil.get_ascii_bytes(get_id).length end |
#send(out) ⇒ Object
/***
298 * Write all the data to the output stream.
299 * If you override this method make sure to override
300 * #length() as well
301 *
302 * @param out The output stream
303 * @throws IOException If an IO problem occurs.
304 */
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/xds/xds_part.rb', line 27 def send( out) sendStart(out); sendDispositionHeader(out) sendContentTypeHeader(out) send_id(out) sendTransferEncodingHeader(out) sendEndOfHeader(out) sendData(out) sendEnd(out) end |
#send_id(out) ⇒ Object
14 15 16 17 |
# File 'lib/xds/xds_part.rb', line 14 def send_id(out) out.write(XDS::CRLF_BYTES) out.write(org.apache.commons.httpclient.util.EncodingUtil.get_ascii_bytes(get_id)) end |