Tabnine Logo
DiskLruCache.edit
Code IndexAdd Tabnine to your IDE (free)

How to use
edit
method
in
com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache

Best Java code snippets using com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache.edit (Showing top 12 results out of 315)

origin: nostra13/Android-Universal-Image-Loader

/**
 * Returns an editor for the entry named {@code key}, or null if another
 * edit is in progress.
 */
public Editor edit(String key) throws IOException {
  return edit(key, ANY_SEQUENCE_NUMBER);
}
origin: nostra13/Android-Universal-Image-Loader

@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: nostra13/Android-Universal-Image-Loader

@Override
public boolean save(String imageUri, InputStream imageStream, IoUtils.CopyListener listener) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean copied = false;
  try {
    copied = IoUtils.copyStream(imageStream, os, listener, bufferSize);
  } finally {
    IoUtils.closeSilently(os);
    if (copied) {
      editor.commit();
    } else {
      editor.abort();
    }
  }
  return copied;
}
origin: com.nostra13.universalimageloader/universal-image-loader

/**
 * Returns an editor for the entry named {@code key}, or null if another
 * edit is in progress.
 */
public Editor edit(String key) throws IOException {
  return edit(key, ANY_SEQUENCE_NUMBER);
}
origin: wanliyang1990/WliveTV

/**
 * Returns an editor for the entry named {@code key}, or null if another
 * edit is in progress.
 */
public Editor edit(String key) throws IOException {
  return edit(key, ANY_SEQUENCE_NUMBER);
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * Returns an editor for the entry named {@code key}, or null if another
 * edit is in progress.
 */
public Editor edit(String key) throws IOException {
  return edit(key, ANY_SEQUENCE_NUMBER);
}
origin: com.nostra13.universalimageloader/universal-image-loader

@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: wanliyang1990/WliveTV

@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * 把图片bitmap存入到缓存器中
 * @param imageUri Original image URI  图片URL地址
 * @param bitmap   Image bitmap   需要保存的图片
 * @return
 * @throws IOException
 */
@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  //流写入文件
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: com.nostra13.universalimageloader/universal-image-loader

@Override
public boolean save(String imageUri, InputStream imageStream, IoUtils.CopyListener listener) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean copied = false;
  try {
    copied = IoUtils.copyStream(imageStream, os, listener, bufferSize);
  } finally {
    IoUtils.closeSilently(os);
    if (copied) {
      editor.commit();
    } else {
      editor.abort();
    }
  }
  return copied;
}
origin: wanliyang1990/WliveTV

@Override
public boolean save(String imageUri, InputStream imageStream, IoUtils.CopyListener listener) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean copied = false;
  try {
    copied = IoUtils.copyStream(imageStream, os, listener, bufferSize);
  } finally {
    IoUtils.closeSilently(os);
    if (copied) {
      editor.commit();
    } else {
      editor.abort();
    }
  }
  return copied;
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
if (editor == null) {
  return false;
com.nostra13.universalimageloader.cache.disc.impl.extDiskLruCacheedit

Javadoc

Returns an editor for the entry named key, or null if another edit is in progress.

Popular methods of DiskLruCache

  • <init>
  • checkNotClosed
  • close
    Closes this cache. Stored values will remain on the filesystem.
  • delete
    Closes the cache and deletes all of its stored values. This will delete all files in the cache direc
  • deleteIfExists
  • get
    Returns a snapshot of the entry named key, or null if it doesn't exist is not currently readable. If
  • getDirectory
    Returns the directory where this cache stores its data.
  • getMaxFileCount
    Returns the maximum number of files that this cache should store
  • getMaxSize
    Returns the maximum number of bytes that this cache should use to store its data.
  • journalRebuildRequired
    We only rebuild the journal when it will halve the size of the journal and eliminate at least 2000 o
  • open
    Opens the cache in directory, creating a cache if none exists there.
  • processJournal
    Computes the initial size and collects garbage as a part of opening the cache. Dirty entries are ass
  • open,
  • processJournal,
  • readJournal,
  • readJournalLine,
  • rebuildJournal,
  • remove,
  • renameTo,
  • trimToFileCount,
  • trimToSize

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Permission (java.security)
    Legacy security code; do not use.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for WebStorm
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