Linked Questions
18 questions linked to/from byte[] to file in Java
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?
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'...
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 ...
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....
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()...
-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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
-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;
...
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()...
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.
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. ...