ascii « API « Java I/O Q&A





1. Java: Reading an ASCII file with FileChannel and ByteArrays    stackoverflow.com

I have the following code:

        String inputFile = "somefile.txt";
     FileInputStream in = new FileInputStream(inputFile);
     FileChannel ch ...

2. Java - is it possible to read a file line by line, stop, and then immediately start reading bytes where I stopped?    stackoverflow.com

I'm having an issue trying to parse the ascii part of a file, and once I hit the end tag, IMMEDIATELY start reading in the bytes from that point on. Everything ...

3. Fastest way of processing Java IO using ASCII lines    stackoverflow.com

I'm working with an ASCII input/output stream over a Socket and speed is critical. I've heard using the right Java technique really makes a difference. I have a textbook that says ...

4. Using a PrintWriter to write ASCII codes to a file    stackoverflow.com

I want to know that when I use PrintWriter for writing to a file. It will write with ASCII code in the file or binary format? Thanks.

5. Unable to write some ascii values above to a file in java    stackoverflow.com

I am writing a java code to write ASCII characters to a file. But when I try to write any character of ASCII value of more than 140 or less than ...

6. Java InputStream read methods returning ASCII 'NUL' characters for file in a NFS mount location    stackoverflow.com

I have a Java process which reads a given file using the Java RandomAccessFile and does some processing based on the file contents. This file is a log file which gets ...

7. Which OutputStream subclass should be used for this case?    stackoverflow.com

I am writing a program that will output data to a .txt file, that can be read by a person using a program like NotePad. Perhaps not necessarily ASCII, but something that ...

8. Getting null-terminated ASCII string from ByteBuffer    coderanch.com

Hi, I apologize if this has already been asked/answered. I looked, but I couldn't find it under anything that I searched for... What I have is a C-struct that was compressed into a string. I can uncompress that data into a ByteBuffer and have been able to get at initial bytes of data (shorts, ints, etc.) but am having problems retrieving ...





10. What is ASCII character for end of stream?    forums.oracle.com

kkus wrote: In socket, read() != -1 never be reached, which incurred my above question. I want to see what ascii is used to indicate end of stream. That's because whatever is sending the data hasn't closed the socket yet. When it does, your code will get -1. But if your protocol doesn't include closing the socket (for example because you ...

11. IO.DataInputStream.readUTF has problem of handling ascii 128-255    forums.oracle.com

My receiving end servlet uses IO.DataInputStream.readUTF to read in socket stream from my provider end (c++ code). It throw UTFDataFormatException when encountering a character (entered by ALT + 0187) in socket stream. It still happens even after I converted it to UTF-8 format in the provider end before sending to the servlet. It seems that it has problem with any ...

12. Need a fast ascii file reader in Java    forums.oracle.com

private ArrayList readDataFile(String fileName) { String lineData; List fileContents = new ArrayList(); BufferedReader moFile=null; try { moFile = new BufferedReader (new FileReader (new File ( fileName))); while ((lineData = moFile.readLine()) != null) { fileContents.add(lineData); } } catch(IOException e) { myLogger.error("Exception caught while reading data file: " + fileName + e.toString()); }finally { try { moFile.close(); }catch(Exception e) { //Ignore } } ...