Beispiel #1
0
  protected void writeBody(ID3DataOutputStream oIDOS) throws IOException {
    // frame identifier
    oIDOS.write(m_abyFrameIdentifier);

    // url
    oIDOS.write(m_sURL.getBytes());
    oIDOS.writeUnsignedByte(0);

    // additional data
    oIDOS.write(m_sAdditionalData.getBytes());
  }
  protected void writeBody(ID3DataOutputStream oIDOS) throws IOException {
    // text encoding
    oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
    // price string
    oIDOS.write(m_sPrice.getBytes());
    oIDOS.writeUnsignedByte(0);
    // valid until
    oIDOS.write(m_sValidUntil.getBytes());
    // contact url
    oIDOS.write(m_sContactUrl.getBytes());
    oIDOS.writeUnsignedByte(0);
    // received as
    oIDOS.writeUnsignedByte(m_byReceivedAs);
    // name of seller
    if (m_sNameOfSeller != null) {
      oIDOS.write(m_sNameOfSeller.getBytes(m_oTextEncoding.getEncodingString()));
    }
    // null terminating optional name of seller
    if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1)) {
      oIDOS.writeUnsignedByte(0);
    } else {
      oIDOS.writeUnsignedByte(0);
      oIDOS.writeUnsignedByte(0);
    }
    // description
    if (m_sDescription != null) {
      oIDOS.write(m_sDescription.getBytes(m_oTextEncoding.getEncodingString()));
    }
    // null terminating optional description
    if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1)) {
      oIDOS.writeUnsignedByte(0);
    } else {
      oIDOS.writeUnsignedByte(0);
      oIDOS.writeUnsignedByte(0);
    }
    // optional company logo image
    if (m_abySellerLogoData != null) {
      // image mime type (optional, "image/" assumed if not set)
      if (m_sPictureMimeType != null) {
        oIDOS.write(m_sPictureMimeType.getBytes());
      }
      oIDOS.writeUnsignedByte(0); // terminating null

      // actual image data
      oIDOS.write(m_abySellerLogoData);
    }
  }