bit « Development « Java I/O Q&A





1. How can I read/write bits from/to a file in Java?    stackoverflow.com

I need to read file stream as bits and then I should be able to write bits to file again. Are there any classes for this purpose?

2. What is the maximum file size 32 bit java can access?    stackoverflow.com

What is the maximum file size 32 bit java can access? Is this architecture dependent?

3. Is it possible to read/write bits from a file using JAVA?    stackoverflow.com

To read/write binary files, I am using DataInputStream/DataOutputStream, they have this method writeByte()/readByte(), but what I want to do is read/write bits? Is it possible? I want to use it for ...

4. Change Sticky bit with Java    stackoverflow.com

Is there any way to add/remove the sticky bit (S_ISVTX) on a file and a directory with Java ?

5. How to write numbers as 4-bit elements to a file?    stackoverflow.com

I want to save space when writing my data to file. That is I want to store my int numbers as half byte (4bits) only for each digit. I can't write ...

6. Archive bit    coderanch.com

From Java IO by O'Reilly: Java allows you to test a fairly broad section of possible file attributes but, doen't allow easy access to platform specific attributes like Mac file types and creator codes, Windows archive attribute and Unix group IDs. If you wish to chane the attribute, you could Runtime.exec() the attrib command. However, I don't know of an easy ...

7. A bit confused about File pathnames    coderanch.com

8. a bit of advice    coderanch.com

Hey there. Not too sure if I should be posting this query here but it is so general that I wasn't sure where to post it. Basically what I want to do is to record every user interaction that a particular user has with a map representation in some sort of log file. My program renders maps to the screen and ...

9. Files and archive bits...    coderanch.com





10. Read 64-bit long via USB    coderanch.com

Hello all, As suggested by the subject, I need to get a 64 bit number from a USB connection. The USB connection goes to a serial number chip which holds a unique number which I will then store in a MySQL database. Problem is, I don't have a clue where to begin. I searched this forum, and found some references to ...

11. shifting and writing bits (bytes) from longs?..tricky!    coderanch.com

hi. i'm in the process of implementing the LZW compression. we hav to used fix length encoding, starting from 10 upto 32 bits per code. i think i'm right in understanding this: bufferedwriter, write(), only writes a byte at at time. now i have to pad my first 256 compressions codes (simply the ascii values) with two 00 to make them ...

12. need suggestion for dividing a file into blocks of 128 bits.    coderanch.com

Hi there is a school project for RSA Cryptography here is the requirement. 1. The encryption algorithm will encrypt content of a file and write out another file 2. The decryption algorithm will decrypt the file encrypted using the corresponding keys and write out a file with the same content as the original data file 3. The two prime numbers: p ...

13. MappedByteBuffers on 32-bit vs. 64-bit systems    coderanch.com

Hi all, In the course of performance testing and optimization of my large-file, I/O intensive application, it has become apparent that it could benefit from switching the stream-based input to a NIO MappedByteBuffer approach. The micro-benchmarks look good (5x speed improvement on read operations) and I am working on a production implementation and real-world benchmarks. One thing that has come up ...

14. 16 bit error?    coderanch.com

Hi All, jdk:1.4 OS:Windows 2000 server: Jboss configured with tomcat I have a application in which there is a file upload option. While uploading a standard file I am getting an error in Windows 2000 OS stating as follows:-createprocess:filenotfound in jboss configured with tomcat server How to make 32 bit processor compatible with 16-bit processor application? But the above problem doesn't ...

15. reading a file by bits    coderanch.com

I am trying to find a good way to read and write data one bit at a time. I found the class RandomAccessFile which has methods of writing and reading one byte at a time. But I want to read and write one bit at a time. Even the readBoolean() and writeBoolean() methods are one byte at a time. It seems ...

16. Calculation of total bits in a file    coderanch.com





17. Inputting both fixed-length strings and 32-bit integers from the same file    coderanch.com

I usually use Scanner for inputting from files, but now I'm trying to input a from a non-Java optimized file that contains both fixed-length strings (effectively char arrays, of varying lengths), and 32-bit integers. There is a specified format for this, but the integers and strings are interspersed. For example, this might be an input file: book meow 8490 strawberry 2239 ...

18. Read / write file bit by bit    coderanch.com

Hello, I need to do this assignment in which I need to read / write from / to a file bit by bit using a buffer. When the buffer has 8 bits, I write a byte to the file, same for reading. Here is why I did so far, I'm using String for reading/writing and I'm sure this is not a ...

19. RXTX Bug on Win 7 64 bits    coderanch.com

Hi. I'm trying to make a direct communication with a POS printer emulator , the problem is , to the emulator execute the command I write by the OutPutStream write method wich I get from SerialPort.getOutputStream , I have to run the application twice on eclipse , but if I run the application twice and open the serial port on any ...

20. Writing bits in file using java    coderanch.com

21. Read a file bit by bit?    java-forums.org

Hello. I have tried to google for this information, but people either instantly refer to the readByte() method in the various I/O packages or just say that it can't be done. Anyways, I have ONE byte, in which each one of the 8 bits means a training for an employee in my data.. for instance... The left most bit indicates orientation ...

22. How do you write 32 bits to a file?    forums.oracle.com

23. How to read in 32 bit from a file?    forums.oracle.com

Hey guys, I am not sure in how to read 32 bits from a file and to what data type to store it. I have a file with binary instructions in for example: 010010111000001101001110101111100 etc... first of all what type should I use? Im not sure will ints do? and How would i be able to read 32 bits? simply with ...

24. java.io.FileNotFoundException: (Too many open files) on 64 bit computers    forums.oracle.com

Hi! I have a java application than instantiates a LogFile object. This LogFile Object is invoked bu my application to push an error message to the text file where the LogFile object is linked. The application works fine on the 32-bit linux computer. But the application returns: java.io.FileNotFoundException: (Too many open files) when I am running the application on a 64-bit ...

25. how to copy file by bits    forums.oracle.com

First of all, you probably want to deal with bytes, not bits. There are no classes in the standard API's that deal with reading bits, anyway. Second of all, what's wrong with using an InputStream? Basically, it's what you are already doing in your copy method now... Just stop when you've read the number of bytes you want. If you insist ...

26. writing bits in the file    forums.oracle.com

27. writing bits in the file    forums.oracle.com

hi I make a program in java which compress the text. The program generates the unique bit sequence for the unique word. the problem is when I want to write bits in file no method is present.So for that I use the StringBuffer which store the code in the form of characters i.e. '0' and '1' after that I convert the ...

28. How can I get to read a large file and not break it up into bits    forums.oracle.com

Hi, How do I read a large file and not get the file cut into bits so each has its own beginning and ending. like 1.aaa 2.aaa 3.aaa 4.... ... ... 10.bbb 11.bbb 12.bbb 13.bbb if the file was read on the line 11 and I wanted to read at 3 and then read again at 10. how do I specify ...

29. two way Directory replicator in bit level    forums.oracle.com

I have tried to read and write files using BufferedInputStream, it worked great with text files. Here comes the bit what file type I wanted to replicate. I wanted to replicate virtual disks (VMWare) where I tried basically to read and write it to find out how it goes, the results were that the output virtual disk was created but corrupted ...

30. how to write 1 bit monochrome bmp file    forums.oracle.com

Hi All, I need to write a 1 bit BMP image file using java normally using java imageIO we can write a 16 bit or 256 bit bmp file but i think imageIO does not support 1 bit monochrome bmp file . so how can i write this file thanks, prashant malik

31. Bits in a Carrier file    forums.oracle.com