Skip to content

Commit

Permalink
Add final on static ByteArray methods back
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed May 11, 2016
1 parent 84b2921 commit 53f58ae
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,30 @@ public final void copyTo(byte[] target) {
/**
* Creates a {@code ByteArray} object given an array of bytes. The bytes are copied.
*/
public static ByteArray copyFrom(byte[] bytes) {
public final static ByteArray copyFrom(byte[] bytes) {
return new ByteArray(ByteString.copyFrom(bytes));
}

/**
* Creates a {@code ByteArray} object given a string. The string is encoded in {@code UTF-8}. The
* bytes are copied.
*/
public static ByteArray copyFrom(String string) {
public final static ByteArray copyFrom(String string) {
return new ByteArray(ByteString.copyFrom(string, StandardCharsets.UTF_8));
}

/**
* Creates a {@code ByteArray} object given a {@link ByteBuffer}. The bytes are copied.
*/
public static ByteArray copyFrom(ByteBuffer bytes) {
public final static ByteArray copyFrom(ByteBuffer bytes) {
return new ByteArray(ByteString.copyFrom(bytes));
}

/**
* Creates a {@code ByteArray} object given an {@link InputStream}. The stream is read into the
* created object.
*/
public static ByteArray copyFrom(InputStream input) throws IOException {
public final static ByteArray copyFrom(InputStream input) throws IOException {
return new ByteArray(ByteString.readFrom(input));
}
}

0 comments on commit 53f58ae

Please sign in to comment.