Skip to content

Manifest#write blindly casts bytes to chars #20

@michael-o

Description

@michael-o
for ( byte b : byteArrayOutputStream.toByteArray() )
  {
    writer.write( (char) b );
  }

This loop is error-prone because a byte does not necessarily represent a char. If a multibyte character is encountered, the output will be mangled.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions