Skip to content

Commit 333d0e2

Browse files
rsafonsecayadvr
authored andcommitted
Fix 3 findbugs encoding warnings Vmdk descriptor files used by ESX should be UTF-8 encoded
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent f5f9388 commit 333d0e2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎vmware-base/src/com/cloud/hypervisor/vmware/mo/VmdkFileDescriptor.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public VmdkFileDescriptor() {
3939
public void parse(byte[] vmdkFileContent) throws IOException {
4040
BufferedReader in = null;
4141
try {
42-
in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent)));
42+
in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkFileContent),"UTF-8"));
4343
String line;
4444
while ((line = in.readLine()) != null) {
4545
// ignore empty and comment lines
@@ -93,8 +93,8 @@ public static byte[] changeVmdkContentBaseInfo(byte[] vmdkContent, String baseFi
9393
ByteArrayOutputStream bos = new ByteArrayOutputStream();
9494

9595
try {
96-
in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkContent)));
97-
out = new BufferedWriter(new OutputStreamWriter(bos));
96+
in = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkContent),"UTF-8"));
97+
out = new BufferedWriter(new OutputStreamWriter(bos,"UTF-8"));
9898
String line;
9999
while ((line = in.readLine()) != null) {
100100
// ignore empty and comment lines

0 commit comments

Comments
 (0)