diff options
author | Alex Clayton <alex.clayton@isode.com> | 2016-01-26 16:33:29 (GMT) |
---|---|---|
committer | Alex Clayton <alex.clayton@isode.com> | 2016-01-27 12:29:01 (GMT) |
commit | 91e97e936fe671678758702bbede6a47b5487f13 (patch) | |
tree | f92b1939fb1704d602f30cbf3791bb98d1a56018 /src/com/isode/stroke/filetransfer/FileReadBytestream.java | |
parent | 97a085f7e2c9b7820000eaace97dc0ab6392cb0d (diff) | |
download | stroke-91e97e936fe671678758702bbede6a47b5487f13.zip stroke-91e97e936fe671678758702bbede6a47b5487f13.tar.bz2 |
Some fixes for File Transfer Patch
Some fixes that were required for the File Transfer Patch (see patch notes
on Gerrit).
Test-information:
By code inspection.
Ran against MLC (after modification so it works for stroke interface changes
introduces in a previous patch) it still runs correctly.
Ran unit tests they still all pass.
Change-Id: Ib49d9f9160f5e6b6b578f16695f8e8bc0f96a412
Diffstat (limited to 'src/com/isode/stroke/filetransfer/FileReadBytestream.java')
-rw-r--r-- | src/com/isode/stroke/filetransfer/FileReadBytestream.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/isode/stroke/filetransfer/FileReadBytestream.java b/src/com/isode/stroke/filetransfer/FileReadBytestream.java index d349c17..53cb974 100644 --- a/src/com/isode/stroke/filetransfer/FileReadBytestream.java +++ b/src/com/isode/stroke/filetransfer/FileReadBytestream.java @@ -31,9 +31,10 @@ public class FileReadBytestream extends ReadBytestream { if (stream == null) { stream = new FileInputStream(file); } - ByteArray result = new ByteArray(); //assert(stream.good()); - stream.read(result.getData(), 0, size); + byte[] buffer = new byte[size]; + stream.read(buffer, 0, size); + ByteArray result = new ByteArray(buffer); onRead.emit(result); return result; } |