SWFOutputStream correct charset handling when saving NetString (font names)

This commit is contained in:
Jindra Petřík
2022-11-12 21:45:57 +01:00
parent b06c8313b1
commit f7b8b855b6
5 changed files with 5 additions and 34 deletions

View File

@@ -198,23 +198,10 @@ public class SWFOutputStream extends OutputStream {
* @throws IOException
*/
public void writeNetString(String value) throws IOException {
byte[] data = value.getBytes();
writeUI8(data.length);
write(data);
}
/**
* Writes netstring (length + string) value to the stream
*
* @param value String value
* @param charset
* @throws IOException
*/
public void writeNetString(String value, Charset charset) throws IOException {
byte[] data = value.getBytes(charset);
writeUI8(data.length);
write(data);
}
}
/**
* Writes UI32 (Unsigned 32bit integer) value to the stream