@Test public void testWriteUnicodeBody() throws IOException { FrameBodyUSLT fb = new FrameBodyUSLT(TextEncoding.UTF_16, "eng", "", UTF16_REQUIRED); ByteArrayOutputStream baos = new ByteArrayOutputStream(); fb.write(baos); FileOutputStream fos = new FileOutputStream(TestUtil.getTestDataTmpFile("TEST.TXT")); fos.write(baos.toByteArray()); byte[] frameBody = baos.toByteArray(); byte[] correctBits = makeByteArray(new int[]{0x01, 'e', 'n', 'g', 0xff, 0xfe, 0x00, 0x00, 0xff, 0xfe, 0x26, 0x20}); String s = cmp(correctBits, frameBody); if (s != null) { Assert.fail(s); } }
public void write(ByteArrayOutputStream tagBuffer) { this.setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding())); if (!((AbstractString)getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } if (!((AbstractString)getObject(DataTypes.OBJ_LYRICS)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } super.write(tagBuffer); }
FrameBodyUSLT extends AbstractID3v2FrameBody implements ID3v23FrameBody, ID3v24FrameBody { public void write(ByteArrayOutputStream tagBuffer) { this.setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding())); if (!((AbstractString)getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } if (!((AbstractString)getObject(DataTypes.OBJ_LYRICS)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } super.write(tagBuffer); } }
FrameBodyUSLT extends AbstractID3v2FrameBody implements ID3v23FrameBody, ID3v24FrameBody { public void write(ByteArrayOutputStream tagBuffer) { this.setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding())); if (!((AbstractString)getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } if (!((AbstractString)getObject(DataTypes.OBJ_LYRICS)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } super.write(tagBuffer); } FrameBodyUSLT();  FrameBodyUSLT(FrameBodyUSLT body);  FrameBodyUSLT(byte textEncoding, String language, String description, String text);  FrameBodyUSLT(ByteBuffer byteBuffer, int frameSize);  FrameBodyUSLT(Buffer byteBuffer, int frameSize); }
FrameBodyUSLT extends AbstractID3v2FrameBody implements ID3v23FrameBody, ID3v24FrameBody { public void write(ByteArrayOutputStream tagBuffer) { this.setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding())); if (!((AbstractString)getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } if (!((AbstractString)getObject(DataTypes.OBJ_LYRICS)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } super.write(tagBuffer); } FrameBodyUSLT();  FrameBodyUSLT(FrameBodyUSLT body);  FrameBodyUSLT(byte textEncoding, String language, String description, String text);  FrameBodyUSLT(ByteBuffer byteBuffer, int frameSize);  FrameBodyUSLT(Buffer byteBuffer, int frameSize); String getUserFriendlyValue(); void setDescription(String description); String getDescription(); String getIdentifier(); void setLanguage(String language); String getLanguage(); void setLyric(String lyric); String getLyric(); String getFirstTextValue(); void addLyric(String text); void addLyric(Lyrics3Line line); void write(ByteArrayOutputStream tagBuffer); }
FrameBodyUSLT extends AbstractID3v2FrameBody implements ID3v23FrameBody, ID3v24FrameBody { public void write(ByteArrayOutputStream tagBuffer) { this.setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding())); if (!((AbstractString)getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } if (!((AbstractString)getObject(DataTypes.OBJ_LYRICS)).canBeEncoded()) { this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader())); } super.write(tagBuffer); } FrameBodyUSLT();  FrameBodyUSLT(FrameBodyUSLT body);  FrameBodyUSLT(byte textEncoding, String language, String description, String text);  FrameBodyUSLT(ByteBuffer byteBuffer, int frameSize);  FrameBodyUSLT(Buffer byteBuffer, int frameSize); String getUserFriendlyValue(); void setDescription(String description); String getDescription(); String getIdentifier(); void setLanguage(String language); String getLanguage(); void setLyric(String lyric); String getLyric(); String getFirstTextValue(); void addLyric(String text); void addLyric(Lyrics3Line line); void write(ByteArrayOutputStream tagBuffer);  }