Forums Register Login

US-ASCII and File access

+Pie Number of slices to send: Send
Hi everyone,


I have the following in my assignment:

1.

All numeric values are stored in the header information use the formats of the
DataInputStream and DataOutputStream classes.



2.

All text values, and all fields (which are text only), contain only 8 bit characters,
null terminated if less than the maximum length for the field.
The character encoding is 8 bit US ASCII.



so:

1. because US-ASCII is only 7 bit, i think that i should take the ISO-8859-1 or the UTF-8?
2. because DataInputStream extends InputStream , should i take for my database file obligative the DataInputStream
or the FileInputStream extends InputStream
or can i take RandomAccessFile too (RandomAccessFile implements DataInput and
DataInputStrem implements also DataInput)?
+Pie Number of slices to send: Send
I use RandomAccessFile and "ISO-8859-1" for my encoding.
+Pie Number of slices to send: Send
 

Radi Hadzhiyski wrote:1. because US-ASCII is only 7 bit, i think that i should take the ISO-8859-1 or the UTF-8?


I explicitly used the US-ASCII encoding. At work I'm a middleware developer and I have to be very picky (more than needed for this assignment) about codepages/charactersets/encodings...

Radi Hadzhiyski wrote:2. because DataInputStream extends InputStream , should i take for my database file obligative the DataInputStream
or the FileInputStream extends InputStream
or can i take RandomAccessFile too (RandomAccessFile implements DataInput and
DataInputStrem implements also DataInput)?


The formats named in the description matches the formats of the RandomAccessFile. You're safe to use the RAF.
+Pie Number of slices to send: Send
Hi Radi,

Used the same things like Anne: RAF (think that every scjd'er is using that one) and ISO-8859-1 as character encoding.

Kind regards,
Roel
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1636 times.
Similar Threads
Locking a record
Should we always use RandomAccessFile
(NX)Questions about instructions:
How to read MAGIC for db-2x2.db
Reading .db file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:15:16.