Linked Questions

9 votes
3 answers
80k views

Convert bytes[] to 'File' in Java [duplicate]

I have an array of bytes bytes[] doc How can I create an instance of new File from those bytes?
Bob's user avatar
  • 10.8k
1 vote
1 answer
138 views

How to write a byteArray into a File? [duplicate]

So i'm trying to implement a method that inserts a byteArray into a file, and set a new byteArray containing the byteArray that was inserted if that makes any sense. The following is my code however I'...
Omar Fayez's user avatar
0 votes
0 answers
65 views

A java program that creates WAV files [duplicate]

So, my teacher wants me to code a program that creates WAV files, and I really don't know how I should write all the data in bytes, create a file and give it the .WAV extension by only using the ...
JOSE RAMSES DELGADILLO SANCHEZ's user avatar
5 votes
3 answers
22k views

How to upload byte array to S3 bucket in Java?

In a spring boot application I read an image file from a remote service, which returns byte array and in headers I can check what is file extension: ResponseEntity<byte[]> result = restTemplate....
Mandroid's user avatar
  • 7,724
4 votes
1 answer
12k views

how to write IvParameterSpec to a file?

I wrote my SecretKey to a file using the following code. Similarly, I have to write my ivParameterSpec to another file. How can I do this? SecretKey key = KeyGenerator.getInstance("AES").generateKey()...
user2756703's user avatar
-3 votes
1 answer
8k views

How can I produce a Base64 encoded PDF that is read by iText's PdfReader

I am reading an existing PDF (INPUT) using iText: PdfReader reader = new PdfReader(INPUT); I am using this reader instance to manipulate the PDF, but the end result needs to be Base64 encoded (I need ...
Vins's user avatar
  • 3
2 votes
2 answers
3k views

Save itext pdf as blob without physical existence.

I am using this code to generate PDF using iText. First it creates HTML to PDF after that it converts that PDF in byte array or in BLOB or in byte array. I dont want to create any physical stores of ...
ketan sharma's user avatar
8 votes
1 answer
5k views

How to get direct link of remote video from embedded url within a url in Android using JSoup?

I had asked the question previously about how to retrieve the embedded url for a video file and have successfully done so. Now I have a different issue. The json response for a WUnderground API webcam ...
Steve C.'s user avatar
  • 1,365
0 votes
2 answers
4k views

Base64.Decoder returning foreign characters

I am building a small application to turn the text in a text file to Base64 then back to normal. The decoded text always returns some Chinese characters in the beginning of the first line. public ...
K.Milli's user avatar
  • 79
1 vote
2 answers
2k views

Encrypting and decrypting List<String> in java

I have an mobile app and a desktop app.I have multiple list in desktop app. I want to encrypt all the values in the lists and send to a file and later from the mobile app i want retrieve the data from ...
sup's user avatar
  • 101
0 votes
2 answers
2k views

How to write a one-byte value in a binary file-java

I have tried a lot with many ways to write a program that : write a one byte value in a file as it is.. for example write 01010101 in a file.. then i want to read the file and print what i wrote.So it ...
user avatar
-4 votes
2 answers
4k views

Read Bytes from all files in folder

Write program to read bytes from all the files in folder... import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; ...
user2559055's user avatar
0 votes
1 answer
1k views

How to use a string in a destination?

Hopefully a simple question : I have created code to get a username from a log in page : private String username; @PostConstruct public void init() { username = FacesContext.getCurrentInstance()...
user1924104's user avatar
1 vote
2 answers
716 views

How In geb download zip file into the current directory?

I try to use this function: downloadBytes(exportLink.@href) but I get array of bytes. How can I get zip file.
Oleg  Baranovsky's user avatar
1 vote
1 answer
509 views

How to compare 2 text files (content) without loop in Java?

Is there any way to compare 2 text (ODT) files without using loops? The point is, inside a servlet, I'm receiving a file from JavaScript and I want to compare it with another stored in the server. ...
Drumnbass's user avatar
  • 946

15 30 50 per page