Codota Logo
ByteArrayPool.<init>
Code IndexAdd Codota 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)

  • Common ways to obtain ByteArrayPool
private void myMethod () {
ByteArrayPool b =
  • Codota Iconnew ByteArrayPool(sizeLimit)
  • Smart code suggestions by Codota
}
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 unpooledIndividualWrites() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  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: 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 unpooledIndividualWrites() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
  writeBytesIndividually(pool);
}
origin: jiangqqlmj/FastDev4Android

@Test public void unpooled() throws IOException {
  ByteArrayPool pool = new ByteArrayPool(0);
  writeOneBuffer(pool);
  writeOneBuffer(pool);
  writeOneBuffer(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

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now