Exam 19: Streams and Binary Inputoutput

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Based on the code below, the statement that would move the file pointer to byte n counted from the beginning of the file is ___________________. RandomAccessFile test = new RandomAccessFile("record.bat", "r");

(Multiple Choice)
4.8/5
(43)

If we read a byte and the value represents an international character equal to 133 using an InputStream object, what is true about the int value we will read?

(Multiple Choice)
4.9/5
(38)

Assume we have a RandomAccessFile object, file, that stores a set of records of class MyData. The size of each record is MyData.RECORD_SIZE. Assume MyData has read and write methods both of which take a RandomAccessFile as an argument. Method write writes the object at the current location. Method read reads the record from current location of the file into the object. If we are currently at the beginning of the 1st record, which code correctly modifies the 2nd record by changing its color to Color.red through the setColor method?

(Multiple Choice)
4.8/5
(37)

If serializing object obj requires 12 bytes, how many bytes are required to serialize obj 3 times?

(Multiple Choice)
4.7/5
(32)

If you store information in binary form, as a sequence of bytes, you will use the ____ class(es) and their subclasses.

(Multiple Choice)
4.8/5
(38)

Which of the following statements enables you to write output to a text file?

(Multiple Choice)
4.8/5
(39)

Assume we have a RandomAccessFile object, file, which stores a set of records of class MyData, each needing MyData.RECORD_SIZE bytes for storage. Which expression calculates the number of records in the file?

(Multiple Choice)
4.7/5
(33)

Every object is assigned a serial number on the stream. What might be the result if the same object is saved twice?

(Multiple Choice)
4.7/5
(31)

In which package are most classes for file processing found?

(Multiple Choice)
4.8/5
(28)

A file pointer is a position in a random access file. Because files can be very large, The file pointer is of type _______.

(Multiple Choice)
4.9/5
(37)

Which is not a method available in the RandomAccessFile class?

(Multiple Choice)
4.9/5
(28)

Which file storage method is in human-readable form?

(Multiple Choice)
4.9/5
(38)

Objects are saved in ___________ format in object streams.

(Multiple Choice)
4.9/5
(37)

Which of these classes access sequences of characters? I readers II writers III streams

(Multiple Choice)
4.7/5
(28)

Objects saved to an object stream must belong to classes that:

(Multiple Choice)
4.7/5
(43)

Caesar cipher uses a shift of each character by a key with a value between 1 and 255. An a with a shift equal to 3 becomes a d. A z would become a c, wrapping around the alphabet. Which is the encryption of shadow for a key = 3?

(Multiple Choice)
4.9/5
(40)

Use a ____ object to access a file and move a file pointer.

(Multiple Choice)
4.7/5
(33)

How many bytes does the read method in the FileInputStream class actually return to the program call?

(Multiple Choice)
4.8/5
(35)

In Java, you use a(n) ____________ object to access a file and move its file pointer.

(Multiple Choice)
4.9/5
(39)

Streams access sequences of ____.

(Multiple Choice)
4.9/5
(31)
Showing 61 - 80 of 82
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)