summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-05-18 16:43:57 -0700
committerGlenn Kasten <gkasten@google.com>2015-05-19 08:46:48 -0700
commit5db6637f8c6c8b3365f0476f1264bf19dfbc7207 (patch)
treeebe4226f88c0f3396a8255393c4d2dddb56950dc /media/java
parent9939961db9765f4e900955cf64ce1c3ceeb9362e (diff)
downloadframeworks_base-5db6637f8c6c8b3365f0476f1264bf19dfbc7207.zip
frameworks_base-5db6637f8c6c8b3365f0476f1264bf19dfbc7207.tar.gz
frameworks_base-5db6637f8c6c8b3365f0476f1264bf19dfbc7207.tar.bz2
Explain the void send() throws IOException
Bug: 21044677 Change-Id: If6b51058813aff3780821db7c619004622df64ca
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/midi/MidiReceiver.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/media/java/android/media/midi/MidiReceiver.java b/media/java/android/media/midi/MidiReceiver.java
index 85c451f..45cba3b 100644
--- a/media/java/android/media/midi/MidiReceiver.java
+++ b/media/java/android/media/midi/MidiReceiver.java
@@ -89,12 +89,15 @@ abstract public class MidiReceiver {
/**
* Called to send MIDI data to the receiver
* Data will get split into multiple calls to {@link #onSend} if count exceeds
- * {@link #getMaxMessageSize}.
+ * {@link #getMaxMessageSize}. Blocks until all the data is sent or an exception occurs.
+ * In the latter case, the amount of data sent prior to the exception is not provided to caller.
+ * The communication should be considered corrupt. The sender should reestablish
+ * communication, reset all controllers and send all notes off.
*
* @param msg a byte array containing the MIDI data
* @param offset the offset of the first byte of the data in the array to be sent
* @param count the number of bytes of MIDI data in the array to be sent
- * @throws IOException
+ * @throws IOException if the data could not be sent in entirety
*/
public void send(byte[] msg, int offset, int count) throws IOException {
send(msg, offset, count, System.nanoTime());
@@ -103,13 +106,16 @@ abstract public class MidiReceiver {
/**
* Called to send MIDI data to the receiver to be handled at a specified time in the future
* Data will get split into multiple calls to {@link #onSend} if count exceeds
- * {@link #getMaxMessageSize}.
+ * {@link #getMaxMessageSize}. Blocks until all the data is sent or an exception occurs.
+ * In the latter case, the amount of data sent prior to the exception is not provided to caller.
+ * The communication should be considered corrupt. The sender should reestablish
+ * communication, reset all controllers and send all notes off.
*
* @param msg a byte array containing the MIDI data
* @param offset the offset of the first byte of the data in the array to be sent
* @param count the number of bytes of MIDI data in the array to be sent
- * @param timestamp the timestamp of the message (based on {@link java.lang.System#nanoTime}
- * @throws IOException
+ * @param timestamp the timestamp of the message, based on {@link java.lang.System#nanoTime}
+ * @throws IOException if the data could not be sent in entirety
*/
public void send(byte[] msg, int offset, int count, long timestamp)
throws IOException {