Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Put braces around if-blocks for Adapters/BinaryAdapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosalberto committed Dec 6, 2017
1 parent f7dac8e commit 9110201
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ private Adapters() {}
* @return The new Binary carrier used for injection.
*/
public static Binary injectBinary(OutputStream stream) {
if (stream == null)
if (stream == null) {
throw new IllegalArgumentException("stream");
}

return new BinaryAdapter(Channels.newChannel(stream));
}
Expand All @@ -47,8 +48,9 @@ public static Binary injectBinary(OutputStream stream) {
* @return The new Binary carrier used for injection.
*/
public static Binary injectBinary(WritableByteChannel channel) {
if (channel == null)
if (channel == null) {
throw new IllegalArgumentException("channel");
}

return new BinaryAdapter(channel);
}
Expand All @@ -62,8 +64,9 @@ public static Binary injectBinary(WritableByteChannel channel) {
* @return The new Binary carrier used for extraction.
*/
public static Binary extractBinary(InputStream stream) {
if (stream == null)
if (stream == null) {
throw new IllegalArgumentException("stream");
}

return new BinaryAdapter(Channels.newChannel(stream));
}
Expand All @@ -77,8 +80,9 @@ public static Binary extractBinary(InputStream stream) {
* @return The new Binary carrier used for extraction.
*/
public static Binary extractBinary(ReadableByteChannel channel) {
if (channel == null)
if (channel == null) {
throw new IllegalArgumentException("channel");
}

return new BinaryAdapter(channel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ WritableByteChannel writeChannel() {
}

public int write(ByteBuffer buffer) throws IOException {
if (writeChannel == null)
if (writeChannel == null) {
throw new UnsupportedOperationException();
}

return writeChannel.write(buffer);
}

public int read(ByteBuffer buffer) throws IOException {
if (readChannel == null)
if (readChannel == null) {
throw new UnsupportedOperationException();
}

return readChannel.read(buffer);
}
Expand Down

0 comments on commit 9110201

Please sign in to comment.