Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to extract image from server url and store it in a folder in java

try (BufferedInputStream inputStream = new BufferedInputStream(new URL("http://example.com/my-file-path.txt").openStream());
  FileOutputStream fileOS = new FileOutputStream("/Users/username/Documents/file_name.txt")) {
    byte data[] = new byte[1024];
    int byteContent;
    while ((byteContent = inputStream.read(data, 0, 1024)) != -1) {
        fileOS.write(data, 0, byteContent);
    }
} catch (IOException e) {
    // handles IO exceptions
}
Comment

PREVIOUS NEXT
Code Example
Java :: matlab leslie eigenvalue java 
Java :: selenium firefox to foreground -python java 
Java :: how to make character in jframe 
Java :: java streams example 
Sql :: safe update mysql 
Sql :: codeigniter print last sql query 
Sql :: mysql set max connections 
Sql :: alter session set nls_date_format 
Sql :: postgres get columns names 
Sql :: GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 
Sql :: get role postgres 
Sql :: drop stored procedure mysql 
Sql :: mysql how to reset primary key 
Sql :: sql list all procedures 
Sql :: sql list all databases 
Sql :: get all tables postgres 
Sql :: sql server alter table column nullable 
Sql :: query to find table size in oracle 12c 
Sql :: postgresql truncate cascade restart identity 
Sql :: sql add date hour 
Sql :: oracle search code in packages 
Sql :: convert varchar to int in sqlite 
Sql :: tsql get beginning of year 
Sql :: Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. 
Sql :: status mysql 
Sql :: sql count duplicate rows 
Sql :: install mysqldump ubuntu 
Sql :: raw query must include primary key 
Sql :: Starting mysql shell lampp ubuntu 
Sql :: mysql id reset 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =