Questions tagged [java-io]

The java.io package provides blocking input and output through data streams, serialization, and the file system.

Most applications need to process some input and produce some output based on that input. The purpose of the Java IO package (java.io) is to make that possible in Java.

The java.io package provides blocking input and output through data streams, serialization and the file system.

1753 questions
0
votes
1 answer

when i m trying to make .war file of my WEB-INF folder to deploy in tomcat6, cmd shows error java.io.Filenotfound Exception now., what can i do

when i m trying to make .war file of my WEB-INF folder to deploy in tomcat6, Microsoft Windows (Version 6.2.9200)' (c) 2012 Microsoft Corporation. All rights reserved.' C:\Program Files (x86)\Apache Software Foundation\Tomcat6.0\webapps>jar cvf …
Meow
  • 42
  • 8
0
votes
2 answers

BufferedReader not reading all lines

I am in the process of creating an Android application that communicates with the PC using a Bluetooth connection. I am attempting to send items from an ArrayList from the PC to the Android.
user1909680
  • 95
  • 1
  • 3
  • 12
0
votes
1 answer

How can I read a text file and display it using JoptionPane?

I am trying to take in user input and storing it in a text file, I was able to take in the input and storing it but now i am trying to display that input in a JOptionPane window. Can someone please help me. I am new on stackflow and this is my first…
David Nkanga
  • 1
  • 1
  • 3
0
votes
1 answer

How to read/change bytecode of a mp3 file?

I can read mp3 file and can play it. But now i want to change bytecode of a mp3 file. How i can see bytecode of a mp3 file ??? I also want to edit bytecode. I am searching Google for 2 days but can not find any solution. I will be very grateful if…
user2166895
  • 81
  • 1
  • 1
  • 7
0
votes
1 answer

BufferedReader was never closed, but file was able to delete

Recently, I reviewed our application code, and I found one issue in our code. /** * truncate cat tree(s) from the import file */ private void truncateCatTreesInFile(File file, String userImplCode) throws Exception { String rowStr = null,…
Jack Zhang
  • 304
  • 1
  • 9
  • 21
0
votes
2 answers

readXmlfile from java

Hello I've written small class in java to read in xml file as a string, not my question is following : how do I append string so it outputs only what is between Physical_Order_List_Array tags here is a java class : public static String…
ant
  • 22,634
  • 36
  • 132
  • 182
0
votes
1 answer

Read text files into 2D array?

I want to read a list of text files into a 2D array. The code throws a run time error on reading into the array. How can I fix this? public static void main(String[] args) throws IOException { byte[][] str = null; File file=new…
user2002858
  • 341
  • 2
  • 7
  • 18
0
votes
7 answers

Reading from a .txt file in java

I have a .txt file with some numbers. It looks like this: 1 4364 658 4328 666 2 5109 659 5100 638 3 4936 659 4904 677 4 4936 659 4957 639 5 5518 660 5602 672 I need to extract all numbers, except first column (1, 2, 3, 4, 5 ...), and use them for…
ttwis
  • 368
  • 1
  • 4
  • 16
0
votes
4 answers

read file into two dimensional array

I am trying to read a file into a two dimensional array. When I read it in, in the first section, the values are correct. When I write it out, the values are all have the value "10". How can I fix this? public static void readagain() { try { …
user2002858
  • 341
  • 2
  • 7
  • 18
0
votes
2 answers

FileInputStream not finding the file

I am making a program in java that will read a file and put each word from it into an array so I can make an anagram of each word after sorting them to a default array. I have a good idea of how to do this, except my .txt file is not being read. I…
Ryan Tibbetts
  • 412
  • 1
  • 8
  • 22
0
votes
3 answers

Netbeans cannot find java.io.InputStream

Actually, he cannot find java.io. It recognizes import java.io.*; import java.io.IOException; but when I try InputStream = this.getClass().getResourceAsStream("users.xml");, i get the following error:…
Pantaziu Cristian
  • 882
  • 2
  • 14
  • 26
0
votes
3 answers

Teacher wants only one if for 3 [(a OR b) AND c] questions

This is a weird question, I know, but I need to write a program with 3 questions basically [(a OR b) AND c] without using if. What my teacher wants us to ask the user if an animal is black and answer y or n. If n ask if it is white and answer y or…
Mary Ross
  • 31
  • 2
0
votes
1 answer

RegexFileFilter behaves differently when running in jboss 7

I need to sort files based on their name and extension. I use apache commons-io RegexFileFilter for that. The filename pattern is something like this: "filename.xml.20130101200" or "filename.xml.20130101200.inprog", where numbers are simple…
jyriand
  • 2,434
  • 3
  • 23
  • 28
0
votes
1 answer

Converting file to byte array and transmitting it with UDP. How to get file name on server from this array of bytes?

So I read a file into a byte array and then I break it up into chunks and send it across the network with UDP. Path path = Paths.get("files_upload/music.mp3"); byte[] objectBytes = Files.readAllBytes(path); On the server I read all the chunks into…
csss
  • 1,937
  • 2
  • 14
  • 24
0
votes
2 answers

mark and readAheadLimit

I have a case where I need to peek ahead in the stream for the existence of a certain regular expression and then read data from the stream. mark and reset allow me to do this but I am facing an issue where mark becomes invalid if the…
Anuj Kaushal
  • 61
  • 1
  • 6
1 2 3
99
100