Questions tagged [fileoutputstream]

FileOutputStream is a Java class used to write bytes directly to a File or to a FileDescriptor.

FileOutputStream is a Java class used to write bytes directly to a File or to a FileDescriptor.

Whether or not a file is available or may be created depends upon the underlying platform. Some platforms, in particular, allow a file to be opened for writing by only one FileOutputStream (or other file-writing object) at a time. In such situations the constructors in this class will fail if the file involved is already open.

FileOutputStream is meant for writing streams of raw bytes such as image data. For writing streams of characters, consider using FileWriter.

1082 questions
-2
votes
1 answer

Serializing object with java

I am trying to serialize an object with ObjectOutputStream and FileOutputStream, however an error with the class name is being shown. JFileChooser fc = new JFileChooser(); NewClientClass AddClient = new NewClientClass(IDNumber.getText(),…
-3
votes
2 answers

FileOutputStream with java 8 and try with resource gettng error

I am writing serialization code for eclipse I am trying to use FileOutputStream with try-with-resource but I am getting a error message : "Resource specification not allowed here for source level below 1.7" And as fix Eclipse is showing the message…
-3
votes
1 answer

Return as ByteArrayOutputStream instead of FileOutputStream

I have a requirement to generate PDF file from JSON Objects and am able to produce PDF document using Apache FOP and Java. But i want to return the PDF file as ByteArrayOutputStream and then i have to encode like this…
Karthikeyan
  • 1,505
  • 2
  • 21
  • 61
-3
votes
1 answer

spring mvc outputStream csv

How to split de code into Service, repository and controller (Spring mvc) this code work for me but not good split. Big table large table to expose API REST @ApiOperation(value = "Search all customers",response = GoldenCustomer.class) …
BBAH
  • 46
  • 5
-3
votes
1 answer

Writing a large resultset to an .xlsx file using Apache POI and JDBC

I'm trying to write a large(Total no of rows can be up to 2 million) resultset to an .xlsx file. To over come heap space or memory errors, I decided to fetch some limited set of records from table in each call and append the same to the file. Those…
-3
votes
2 answers

Writer not writing anything to file

public class AddDetails extends Application { private final String FileName = "C:\\Users\\marsh\\OneDrive\\Documents\\CustomPrograms\\CalcProb\\Players.txt"; private String Name; private char Hand1, Hand1; private double Skill1,…
-3
votes
2 answers

FileOutputStream alternative for Java 1.6

I have to retrofit a piece of java code that must be compatible with Java 1.6 and I'm looking for an alternative for fileoutputstream in the following function. I am using apache.commons FTP package. import org.apache.commons.net.ftp.FTP; import…
Tacitus86
  • 1,030
  • 2
  • 8
  • 21
-3
votes
1 answer

How to make a folder which contains many files in Java?

I want to make a folder which contains files that my program made. For example (this example doesn't represent the things that my program actually does): private static HashMap numbers = new HashMap<>(); private static ListIterator…
F.Stan
  • 524
  • 1
  • 10
  • 21
-3
votes
1 answer

Image read/write in Java without imageio between local file systems

I'm very new to Java and I'm recently making a program which reads image files(jpg) from one directory, and write(copy) them to another directory. I can't use imageio or move/copy methods and I also have to check the time consuming caused by the R/W…
hamm.tax
  • 13
  • 3
-3
votes
1 answer

two matrix output into a single txt file in matlab

I've two matrix output from two Matlab scripts and I'd like to write both results in different columns of the same GUI output in a txt file. Could you please help me?
-3
votes
1 answer

Replace Random Access File Logics with FileOutput streams

My code currently use RandomAccessFile to read a ZIP file. The code is taken from a open source project. I need to make RANDOM Access File operation in memory without creating a physical File in the disk. So need to replace functionality of…
user3693532
  • 51
  • 1
  • 3
-3
votes
3 answers

using FileInputStream and FileOutputStream

Hi I had a couple of questions about using the FileInputStream and FileOutputStream classes. How would FileInputStream objects locate a file it is trying to read in? Where would FileOutputStream save a file to? Thanks.
user2910237
  • 133
  • 1
  • 1
  • 7
-4
votes
2 answers

Is there an -1 at the end of an Inputstream?

I am quite new to programming. While reading the article Byte Streams in "Basic I/O" in The Java Tutorials by Oracle, I came accross this code: import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public…
Auri
  • 1
-4
votes
2 answers

FileNotFoundException:EACCES (Permission denied)

I get data from my service : JSONObject userGuid = new JSONObject(); userGuid.put("userGuid", id); Bitmap bitmap = null; String response = HttpUtil.post(mService + "GetUser", userGuid.toString(), mCookie); …
sayres
  • 171
  • 2
  • 14
-4
votes
3 answers

Could not save image in external directory

I could not save Image in external directory in my android app. I practices myself and searched for the same problem but nothing could help me. All i want to do is display a dialog with that image, and give user a option to save it and if saved view…
1 2 3
72
73