コード例 #1
0
  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);
    }
  }
コード例 #2
0
 protected void writeBody(ID3DataOutputStream oIDOS) throws IOException {
   // text encoding
   oIDOS.writeUnsignedByte(m_oTextEncoding.getEncodingValue());
   // language
   oIDOS.write(m_sLanguage.getBytes());
   // content descriptor
   if (m_sContentDescriptor != null) {
     oIDOS.write(m_sContentDescriptor.getBytes(m_oTextEncoding.getEncodingString()));
   }
   // null separating content descriptor from lyrics
   if (m_oTextEncoding.equals(TextEncoding.ISO_8859_1)) {
     oIDOS.writeUnsignedByte(0);
   } else {
     oIDOS.writeUnsignedByte(0);
     oIDOS.writeUnsignedByte(0);
   }
   // lyrics
   oIDOS.write(m_sLyrics.getBytes(m_oTextEncoding.getEncodingString()));
 }