congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ByteArrayPool.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.android.volley.toolbox.ByteArrayPool
constructor

Best Java code snippets using com.android.volley.toolbox.ByteArrayPool.<init> (Showing top 20 results out of 315)

origin: mcxiaoke/android-volley

/**
 * @param httpStack HTTP stack to be used
 */
public BasicNetwork(HttpStack httpStack) {
  // If a pool isn't passed in, then build a small default pool that will give us a lot of
  // benefit and not use too much memory.
  this(httpStack, new ByteArrayPool(DEFAULT_POOL_SIZE));
}
origin: chentao0707/SimplifyReader

/**
 * @param httpStack HTTP stack to be used
 */
public BasicNetwork(HttpStack httpStack) {
  // If a pool isn't passed in, then build a small default pool that will give us a lot of
  // benefit and not use too much memory.
  this(httpStack, new ByteArrayPool(DEFAULT_POOL_SIZE));
}
origin: jiangqqlmj/FastDev4Android

/**
 * @param httpStack HTTP stack to be used
 */
public BasicNetwork(HttpStack httpStack) {
  // If a pool isn't passed in, then build a small default pool that will give us a lot of
  // benefit and not use too much memory.
  this(httpStack, new ByteArrayPool(DEFAULT_POOL_SIZE));
}
origin: mcxiaoke/android-volley

@Test public void pooledIndividualWrites() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(32768);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
}
origin: jiangqqlmj/FastDev4Android

@Test public void pooledIndividualWrites() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(32768);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
}
origin: mcxiaoke/android-volley

@Test public void pooledOneBuffer() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(32768);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
}
origin: mcxiaoke/android-volley

@Test public void unpooled() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
}
origin: mcxiaoke/android-volley

@Test public void unpooledIndividualWrites() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
}
origin: jiangqqlmj/FastDev4Android

@Test public void pooledOneBuffer() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(32768);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
}
origin: jiangqqlmj/FastDev4Android

@Test public void unpooled() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
}
origin: jiangqqlmj/FastDev4Android

@Test public void unpooledIndividualWrites() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
}
origin: mcxiaoke/android-volley

  @Test public void returnsBufferWithRightSize() {
    ByteArrayPool pool = new ByteArrayPool(32);

    byte[] buf1 = pool.getBuf(16);
    pool.returnBuf(buf1);

    byte[] buf2 = pool.getBuf(17);
    assertNotSame(buf2, buf1);

    byte[] buf3 = pool.getBuf(15);
    assertSame(buf3, buf1);
  }
}
origin: jiangqqlmj/FastDev4Android

  @Test public void returnsBufferWithRightSize() {
    ByteArrayPool pool = new ByteArrayPool(32);

    byte[] buf1 = pool.getBuf(16);
    pool.returnBuf(buf1);

    byte[] buf2 = pool.getBuf(17);
    assertNotSame(buf2, buf1);

    byte[] buf3 = pool.getBuf(15);
    assertSame(buf3, buf1);
  }
}
origin: mcxiaoke/android-volley

@Test public void reusesBuffer() {
  ByteArrayPool pool = new ByteArrayPool(32);
  byte[] buf1 = pool.getBuf(16);
  byte[] buf2 = pool.getBuf(16);
  pool.returnBuf(buf1);
  pool.returnBuf(buf2);
  byte[] buf3 = pool.getBuf(16);
  byte[] buf4 = pool.getBuf(16);
  assertTrue(buf3 == buf1 || buf3 == buf2);
  assertTrue(buf4 == buf1 || buf4 == buf2);
  assertTrue(buf3 != buf4);
}
origin: jiangqqlmj/FastDev4Android

@Test public void reusesBuffer() {
  ByteArrayPool pool = new ByteArrayPool(32);
  byte[] buf1 = pool.getBuf(16);
  byte[] buf2 = pool.getBuf(16);
  pool.returnBuf(buf1);
  pool.returnBuf(buf2);
  byte[] buf3 = pool.getBuf(16);
  byte[] buf4 = pool.getBuf(16);
  assertTrue(buf3 == buf1 || buf3 == buf2);
  assertTrue(buf4 == buf1 || buf4 == buf2);
  assertTrue(buf3 != buf4);
}
origin: mcxiaoke/android-volley

@Test public void obeysSizeLimit() {
  ByteArrayPool pool = new ByteArrayPool(32);
  byte[] buf1 = pool.getBuf(16);
  byte[] buf2 = pool.getBuf(16);
  byte[] buf3 = pool.getBuf(16);
  pool.returnBuf(buf1);
  pool.returnBuf(buf2);
  pool.returnBuf(buf3);
  byte[] buf4 = pool.getBuf(16);
  byte[] buf5 = pool.getBuf(16);
  byte[] buf6 = pool.getBuf(16);
  assertTrue(buf4 == buf2 || buf4 == buf3);
  assertTrue(buf5 == buf2 || buf5 == buf3);
  assertTrue(buf4 != buf5);
  assertTrue(buf6 != buf1 && buf6 != buf2 && buf6 != buf3);
}
origin: jiangqqlmj/FastDev4Android

@Test public void obeysSizeLimit() {
  ByteArrayPool pool = new ByteArrayPool(32);
  byte[] buf1 = pool.getBuf(16);
  byte[] buf2 = pool.getBuf(16);
  byte[] buf3 = pool.getBuf(16);
  pool.returnBuf(buf1);
  pool.returnBuf(buf2);
  pool.returnBuf(buf3);
  byte[] buf4 = pool.getBuf(16);
  byte[] buf5 = pool.getBuf(16);
  byte[] buf6 = pool.getBuf(16);
  assertTrue(buf4 == buf2 || buf4 == buf3);
  assertTrue(buf5 == buf2 || buf5 == buf3);
  assertTrue(buf4 != buf5);
  assertTrue(buf6 != buf1 && buf6 != buf2 && buf6 != buf3);
}
origin: jungletian/TitanjumNote

/**
 * @param httpStack HTTP stack to be used
 */
public BasicNetwork(HttpStack httpStack) {
  // If a pool isn't passed in, then build a small default pool that will give us a lot of
  // benefit and not use too much memory.
  this(httpStack, new ByteArrayPool(DEFAULT_POOL_SIZE));
}
origin: cat9/EasyVolley

/**
 * @param httpStack HTTP stack to be used
 */
public BasicNetwork(HttpStack httpStack) {
  // If a pool isn't passed in, then build a small default pool that will give us a lot of
  // benefit and not use too much memory.
  this(httpStack, new ByteArrayPool(DEFAULT_POOL_SIZE));
}
origin: MewX/light-novel-library_Wenku8_Android

@Test public void pooledOneBuffer() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(32768);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
}
com.android.volley.toolboxByteArrayPool<init>

Popular methods of ByteArrayPool

  • getBuf
    Returns a buffer from the pool if one is available in the requested size, or allocates a new one if
  • returnBuf
    Returns a buffer to the pool, throwing away old buffers if the pool would exceed its allotted size.
  • trim
    Removes buffers from the pool until it is under its size limit.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • CodeWhisperer alternatives
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