Skip to content

Commit 0bb3a9c

Browse files
committed
Don't thrash byte arrays around so much
1 parent ac73cdb commit 0bb3a9c

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/main/java/microsoft/exchange/webservices/data/core/EwsXmlReader.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -561,16 +561,7 @@ public byte[] readBase64ElementValue()
561561
throws ServiceXmlDeserializationException, XMLStreamException,
562562
IOException {
563563
this.ensureCurrentNodeIsStartElement();
564-
565-
byte[] buffer = null;
566-
567-
ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
568-
569-
buffer = Base64.decodeBase64(this.xmlReader.getElementText().toString());
570-
byteArrayStream.write(buffer);
571-
572-
return byteArrayStream.toByteArray();
573-
564+
return Base64.decodeBase64(this.xmlReader.getElementText());
574565
}
575566

576567
/**
@@ -583,8 +574,7 @@ public void readBase64ElementValue(OutputStream outputStream)
583574
throws Exception {
584575
this.ensureCurrentNodeIsStartElement();
585576

586-
byte[] buffer = null;
587-
buffer = Base64.decodeBase64(this.xmlReader.getElementText().toString());
577+
byte[] buffer = Base64.decodeBase64(this.xmlReader.getElementText());
588578
outputStream.write(buffer);
589579
outputStream.flush();
590580
}

0 commit comments

Comments
 (0)