summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Clayton <alex.clayton@isode.com>2016-03-16 13:48:37 (GMT)
committerAlex Clayton <alex.clayton@isode.com>2016-03-16 14:05:38 (GMT)
commit8b9891afc85d114ff1e9c9a0291a4aaee8baeb09 (patch)
tree5027dc69d6ca785e0ed94aebc7232b3790b51464 /src/com/isode/stroke/filetransfer/WriteBytestream.java
parent892af8539f2b46e840d7344489529259d1df03b9 (diff)
downloadstroke-8b9891afc85d114ff1e9c9a0291a4aaee8baeb09.zip
stroke-8b9891afc85d114ff1e9c9a0291a4aaee8baeb09.tar.bz2
Add FileWriteBytestream class and test.
Adds a FileWriteBytestream class plus a test for it. These had been missed out previously. Also as per patch 'Fix crash when saving a received file to non-writable location' changed WriteBytestream.write() method to return a boolean indicating success or failure. Test-information: Tests pass ok. Change-Id: I0c3676db8b67573142e8628f439cecf54f3f8f1a
Diffstat (limited to 'src/com/isode/stroke/filetransfer/WriteBytestream.java')
-rw-r--r--src/com/isode/stroke/filetransfer/WriteBytestream.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/isode/stroke/filetransfer/WriteBytestream.java b/src/com/isode/stroke/filetransfer/WriteBytestream.java
index c243bdc..81d2093 100644
--- a/src/com/isode/stroke/filetransfer/WriteBytestream.java
+++ b/src/com/isode/stroke/filetransfer/WriteBytestream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -16,7 +16,14 @@ import com.isode.stroke.signals.Signal1;
public abstract class WriteBytestream {
- public abstract void write(final ByteArray b);
+ /**
+ * Write data from a {@link ByteArray} to the bytestream. On
+ * success {@code true} is returned and {@link #onWrite} is called.
+ * On failure {@code false} is returned.
+ * @param b The {@link ByteArray} to write.
+ * @return {@code true} on success, {@code false} on failure.
+ */
+ public abstract boolean write(final ByteArray b);
public final Signal1<ByteArray> onWrite = new Signal1<ByteArray>();
} \ No newline at end of file