All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sksamuel.scrimage.nio.CachedImageSource Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
package com.sksamuel.scrimage.nio;

import java.io.IOException;

public class CachedImageSource implements ImageSource {

   private byte[] bytes = null;

   private final ImageSource source;

   public CachedImageSource(ImageSource source) {
      this.source = source;
   }

   @Override
   public byte[] read() throws IOException {
      if (bytes == null)
         bytes = source.read();
      return bytes;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy