Questions tagged [random-access]

Random access is the possibility of accessing any given record in a collection in the same time in contrast to sequential access in which distant records take longer to access than nearby records. An array is an example of a random-access data structure which can be contrasted to a list which requires sequential access.

Random access is the possibility of accessing any given record in a collection in the same time in contrast to sequential access in which distant records take longer to access than nearby records. An array is an example of a random-access data structure which can be contrasted to a list which requires sequential access.

See also

345 questions
0
votes
1 answer

EOFException error at reading a RandomAccessFile

I am having some issues at reading bytes from with readInt() when using RandomAccessFile whenever I want to print the File I get EOFException. The same error appears in the last catch Statement when I want to show the updated series of numbers. Here…
Ortharios
  • 610
  • 1
  • 5
  • 10
0
votes
1 answer

How to read and write data directly from disk partition on Windows with random access?

I can open a disk, and do some reads and writes (described here: How do I read a disk directly with .Net?), but I don't know how to seek.
LOST
  • 2,956
  • 3
  • 25
  • 40
0
votes
2 answers

Download a file through the Internet with RandomAccessFile

I was browsing the Internet for random Java code, and I found this source code for a download manager. It uses RandomAccessFile to download the files. The one thing I could not figure out though, was where it would download to. Here is the method…
mattbdean
  • 2,532
  • 5
  • 26
  • 58
0
votes
1 answer

DeleteByName method not being removed from randomAccessFile

Hey my RandomAccessFile application is not working well for my deleteByName method. Basically i want this method to search the store for the Student and then remove it from the RandomAccessFile. The search bit is no problem but the…
Pendo826
  • 1,002
  • 18
  • 47
0
votes
1 answer

Add method not adding Student in RandomAccessFile

Hey my randomAccessFile application is not adding the student to the file. I have set up a student store using an arrayList and the added student is being added to the store but it is not being displayed in the file "ContactDetails.txt". Can…
Pendo826
  • 1,002
  • 18
  • 47
0
votes
1 answer

Another way to write students using RandomAccessFile without static array

I am making an application that stores student details in a file using RandomAccessFile but the only way that i have achieved this is by adding the store students a,b,c,d,e etc... into a static array and using a getBytes method to write it. The…
Pendo826
  • 1,002
  • 18
  • 47
0
votes
1 answer

Add method for RandomAccessFile

Hey i am stuck on an add method for my ArrayList store students which then writes the student store to a text file using randomAccessFile. So i need to be able to add a student to the store and then write it to the file. Can anyone suggest a way i…
Pendo826
  • 1,002
  • 18
  • 47
0
votes
1 answer

Need a way to write a Student from an ArrayList Store using RandomAccessFile

Hey im having a problem. I want to use an arrayList to make a studentStore(I have this done) but when im trying to write the student using RandomAccessFile im clueless. StudentStore details = new StudentStore(); Student a = new Student("Becky…
Pendo826
  • 1,002
  • 18
  • 47
0
votes
4 answers

Calling random functions

public static GetRandomFunc() { switch((int)(Math.random()*NUM_FUNCTIONS) { case 0: functionA(); break; case 1: functionB(); break; case 2: functionC(); …
0
votes
3 answers

Selecting a value proportionally based on its double key

I have a list of values, keyed with doubles between 0 and 1 that represent how likely I think it is for a thing to be useful to me. For example, for getting an answer to a question: 0.5 call your mom 0.25 go to the library 0.6 …
Karen
  • 885
  • 2
  • 7
  • 11
0
votes
2 answers

Reading file and adding text to random character location

I have a text file with a sequence of 4194304 letters ranging from A-D all on one line (4 MB). How would I randomly point to a character and replace the following set of characters to another file that is 100 characters long and write it out to a…
bigbitecode
  • 253
  • 5
  • 16
0
votes
2 answers

How to read a "long" number of bytes from file with RandomAccessFile in java

I'm trying to read a file, from a certain point in the file for a certain number of bytes. RandomAccessFile randomAccessFile = new RandomAccessFile(_file, "r"); randomAccessFile.seek(_offSet); randomAccessFile.read(buffer, 0, _size); Where the…
choppy
  • 739
  • 1
  • 12
  • 22
0
votes
1 answer

Randomly accessing a file from a folder using Matlab

I am trying to randomly access a file from a folder using matlab. Could you suggest how to go about it? I am planning to use randn function, but i don't understand how.
KT Harris
  • 41
  • 1
  • 10
-1
votes
1 answer

How to make 'Published<[String]>.Publisher' conform to 'RandomAccessCollection'

I am trying to make a view that updates based on if the user toggles the favorite button or not. I want the entire view to reconstruct in order to display an array of values whenever that array of values is changed. Inside the view, a for each loop…
-1
votes
2 answers

In Java, how do I overwrite a specific part of a line in a file?

I have a csv file thats formatted like this id,text. Here is an example: helloText,How are you goodbyeMessage,Some new text for a change errorMessage,Oops something went wrong Now lets say for example I want to edit the text part of goodbyeMessage…
cod3min3
  • 585
  • 1
  • 7
  • 23
1 2 3
22
23