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

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

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

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class FileImageSource implements ImageSource {

   private final Path path;

   public FileImageSource(File file) {
      this.path = file.toPath();
   }

   public FileImageSource(Path path) {
      this.path = path;
   }

   @Override
   public byte[] read() throws IOException {
      return Files.readAllBytes(path);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy