diff options
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothOutputStream.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothOutputStream.java | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/framework/java/android/bluetooth/BluetoothOutputStream.java b/framework/java/android/bluetooth/BluetoothOutputStream.java index 117dd47c1a..dfec4e102f 100644 --- a/framework/java/android/bluetooth/BluetoothOutputStream.java +++ b/framework/java/android/bluetooth/BluetoothOutputStream.java @@ -44,15 +44,13 @@ import java.io.OutputStream; * Writes a single byte to this stream. Only the least significant byte of * the integer {@code oneByte} is written to the stream. * - * @param oneByte - * the byte to be written. - * @throws IOException - * if an error occurs while writing to this stream. + * @param oneByte the byte to be written. + * @throws IOException if an error occurs while writing to this stream. * @since Android 1.0 */ public void write(int oneByte) throws IOException { - byte b[] = new byte[1]; - b[0] = (byte)oneByte; + byte[] b = new byte[1]; + b[0] = (byte) oneByte; mSocket.write(b, 0, 1); } @@ -60,19 +58,12 @@ import java.io.OutputStream; * Writes {@code count} bytes from the byte array {@code buffer} starting * at position {@code offset} to this stream. * - * @param b - * the buffer to be written. - * @param offset - * the start position in {@code buffer} from where to get bytes. - * @param count - * the number of bytes from {@code buffer} to write to this - * stream. - * @throws IOException - * if an error occurs while writing to this stream. - * @throws IndexOutOfBoundsException - * if {@code offset < 0} or {@code count < 0}, or if - * {@code offset + count} is bigger than the length of - * {@code buffer}. + * @param b the buffer to be written. + * @param offset the start position in {@code buffer} from where to get bytes. + * @param count the number of bytes from {@code buffer} to write to this stream. + * @throws IOException if an error occurs while writing to this stream. + * @throws IndexOutOfBoundsException if {@code offset < 0} or {@code count < 0}, or if {@code + * offset + count} is bigger than the length of {@code buffer}. * @since Android 1.0 */ public void write(byte[] b, int offset, int count) throws IOException { @@ -84,15 +75,16 @@ import java.io.OutputStream; } mSocket.write(b, offset, count); } + /** * Wait until the data in sending queue is emptied. A polling version * for flush implementation. Use it to ensure the writing data afterwards will * be packed in the new RFCOMM frame. - * @throws IOException - * if an i/o error occurs. + * + * @throws IOException if an i/o error occurs. * @since Android 4.2.3 */ - public void flush() throws IOException { + public void flush() throws IOException { mSocket.flush(); } } |