code: public static ByteBuffer toBuffer(byte[] array) {
          if (array == null)
              return EMPTY_BUFFER;
          return toBuffer(array, 0, array.length);
      }
docs: Create a new ByteBuffer using provided byte array.
  
  @param array the byte array to back buffer with.
  @return ByteBuffer with provided byte array, in flush mode