Tabnine Logo
System.arraycopy
Code IndexAdd Tabnine to your IDE (free)

How to use
arraycopy
method
in
java.lang.System

Best Java code snippets using java.lang.System.arraycopy (Showing top 20 results out of 91,224)

origin: square/okhttp

public static String[] concat(String[] array, String value) {
 String[] result = new String[array.length + 1];
 System.arraycopy(array, 0, result, 0, array.length);
 result[result.length - 1] = value;
 return result;
}
origin: google/guava

@Override
public Object[] toArray() {
 Object[] copyTo = new Object[size];
 System.arraycopy(queue, 0, copyTo, 0, size);
 return copyTo;
}
origin: google/guava

@Override
public Object[] toArray() {
 Object[] result = new Object[contents.length];
 System.arraycopy(contents, 0, result, 0, contents.length);
 return result;
}
origin: google/guava

private static byte[] extract(byte[] result, int length) {
 if (length == result.length) {
  return result;
 } else {
  byte[] trunc = new byte[length];
  System.arraycopy(result, 0, trunc, 0, length);
  return trunc;
 }
}
origin: stackoverflow.com

 public <T> T[] concatenate (T[] a, T[] b) {
  int aLen = a.length;
  int bLen = b.length;

  @SuppressWarnings("unchecked")
  T[] c = (T[]) Array.newInstance(a.getClass().getComponentType(), aLen+bLen);
  System.arraycopy(a, 0, c, 0, aLen);
  System.arraycopy(b, 0, c, aLen, bLen);

  return c;
}
origin: google/guava

 @Override
 protected List<String> create(String[] elements) {
  String[] prefix = {"f", "g"};
  String[] suffix = {"h", "i"};
  String[] all = new String[2 + elements.length + 2];
  System.arraycopy(prefix, 0, all, 0, 2);
  System.arraycopy(elements, 0, all, 2, elements.length);
  System.arraycopy(suffix, 0, all, 2 + elements.length, 2);
  return ImmutableList.copyOf(all).subList(2, elements.length + 2);
 }
}
origin: google/guava

 @Override
 protected List<String> create(String[] elements) {
  String[] suffix = {"f", "g"};
  String[] all = new String[elements.length + suffix.length];
  System.arraycopy(elements, 0, all, 0, elements.length);
  System.arraycopy(suffix, 0, all, elements.length, suffix.length);
  return ImmutableList.copyOf(all).subList(0, elements.length);
 }
}
origin: google/guava

private ArrayTable(ArrayTable<R, C, V> table) {
 rowList = table.rowList;
 columnList = table.columnList;
 rowKeyToIndex = table.rowKeyToIndex;
 columnKeyToIndex = table.columnKeyToIndex;
 @SuppressWarnings("unchecked")
 V[][] copy = (V[][]) new Object[rowList.size()][columnList.size()];
 array = copy;
 for (int i = 0; i < rowList.size(); i++) {
  System.arraycopy(table.array[i], 0, copy[i], 0, table.array[i].length);
 }
}
origin: google/guava

private static Integer[] concat(Integer[] left, Integer[] right) {
 Integer[] result = new Integer[left.length + right.length];
 System.arraycopy(left, 0, result, 0, left.length);
 System.arraycopy(right, 0, result, left.length, right.length);
 return result;
}
origin: google/guava

private static Byte[] concat(Byte[] left, Byte[] right) {
 Byte[] result = new Byte[left.length + right.length];
 System.arraycopy(left, 0, result, 0, left.length);
 System.arraycopy(right, 0, result, left.length, right.length);
 return result;
}
origin: google/guava

private void add(Object[] elements, int n) {
 getReadyToExpandTo(size + n);
 System.arraycopy(elements, 0, contents, size, n);
 size += n;
}
origin: google/guava

/**
 * Appends {@code values}, in order, to the end of the values the built {@link
 * ImmutableIntArray} will contain.
 */
public Builder addAll(int[] values) {
 ensureRoomFor(values.length);
 System.arraycopy(values, 0, array, count, values.length);
 count += values.length;
 return this;
}
origin: google/guava

private static byte[] prepended(byte b, byte[] array) {
 byte[] out = new byte[array.length + 1];
 out[0] = b;
 System.arraycopy(array, 0, out, 1, array.length);
 return out;
}
origin: google/guava

private void growIfNeeded() {
 if (size > queue.length) {
  int newCapacity = calculateNewCapacity();
  Object[] newQueue = new Object[newCapacity];
  System.arraycopy(queue, 0, newQueue, 0, queue.length);
  queue = newQueue;
 }
}
origin: google/guava

@Override
public byte[] getExpected(byte[] bytes) {
 if (initialBytes == null) {
  return checkNotNull(bytes);
 } else {
  byte[] result = new byte[initialBytes.length + bytes.length];
  System.arraycopy(initialBytes, 0, result, 0, initialBytes.length);
  System.arraycopy(bytes, 0, result, initialBytes.length, bytes.length);
  return result;
 }
}
origin: google/guava

@Override
public Set<Entry<K, V>> create(Object... elements) {
 Entry<K, V>[] entries = createArray(elements.length);
 System.arraycopy(elements, 0, entries, 0, elements.length);
 return createFromEntries(entries);
}
origin: google/guava

 @Override
 protected List<String> create(String[] elements) {
  String[] rest = new String[elements.length - 2];
  System.arraycopy(elements, 2, rest, 0, elements.length - 2);
  return Lists.asList(elements[0], elements[1], rest);
 }
})
origin: google/guava

 @Override
 protected Set<AnEnum> create(AnEnum[] elements) {
  AnEnum[] otherElements = new AnEnum[elements.length - 1];
  System.arraycopy(elements, 1, otherElements, 0, otherElements.length);
  return Sets.immutableEnumSet(elements[0], otherElements);
 }
})
origin: google/guava

 @Override
 protected List<String> create(String[] elements) {
  String[] rest = new String[elements.length - 1];
  System.arraycopy(elements, 1, rest, 0, elements.length - 1);
  return Lists.asList(elements[0], rest);
 }
})
origin: google/guava

/**
 * Appends {@code values}, in order, to the end of the values the built {@link
 * ImmutableLongArray} will contain.
 */
public Builder addAll(ImmutableLongArray values) {
 ensureRoomFor(values.length());
 System.arraycopy(values.array, values.start, array, count, values.length());
 count += values.length();
 return this;
}
java.langSystemarraycopy

Javadoc

Copies length elements from the array src, starting at offset srcPos, into the array dst, starting at offset dstPos.

The source and destination arrays can be the same array, in which case copying is performed as if the source elements are first copied into a temporary array and then into the destination array.

Popular methods of System

  • currentTimeMillis
    Returns the current time in milliseconds. Note that while the unit of time of the return value is a
  • getProperty
    Returns the value of a particular system property. The defaultValue will be returned if no such prop
  • exit
  • setProperty
    Sets the value of a particular system property.
  • nanoTime
    Returns the current timestamp of the most precise timer available on the local system, in nanosecond
  • getenv
    Returns the value of the environment variable with the given name, or null if no such variable exist
  • getProperties
    Returns the system properties. Note that this is not a copy, so that changes made to the returned Pr
  • identityHashCode
    Returns an integer hash code for the parameter. The hash code returned is the same one that would be
  • getSecurityManager
    Gets the system security interface.
  • gc
    Indicates to the VM that it would be a good time to run the garbage collector. Note that this is a h
  • lineSeparator
    Returns the system's line separator. On Android, this is "\n". The value comes from the value of the
  • clearProperty
    Removes a specific system property.
  • lineSeparator,
  • clearProperty,
  • setOut,
  • setErr,
  • console,
  • loadLibrary,
  • load,
  • setSecurityManager,
  • mapLibraryName

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • setContentView (Activity)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JPanel (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now