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
7
votes
7 answers

Java: reading strings from a random access file with buffered input

I've never had close experiences with Java IO API before and I'm really frustrated now. I find it hard to believe how strange and complex it is and how hard it could be to do a simple task. My task: I have 2 positions (starting byte, ending byte),…
GreyCat
  • 16,622
  • 18
  • 74
  • 112
7
votes
1 answer

fs.createReadStream() at specific position of file

Is it possible to create a stream that reads from a specific position of file in node.js? I know that I could use a more traditional fs.open / seek / read API, but in that case I need to somehow wrap them in a stream for underlying layers of my…
vdudouyt
  • 843
  • 7
  • 14
7
votes
1 answer

Subtracting and comparing random-access iterators: why and where?

I am developing a small library for my work, and I derived a few classes from the standard random-access iterator category. This allows me to use things like iterator traits and to not worry too much when I use standard libraries like algorithm for…
Jonathan H
  • 7,591
  • 5
  • 47
  • 80
7
votes
3 answers

STL What is Random access and Sequential access?

So I am curious to know, what is random access? I searched a little bit, and couldn't find much. The understanding I have now is that the "blocks" in the container are placed randomly (as seen here). Random access then means I can access every…
Sumsar1812
  • 616
  • 1
  • 9
  • 32
7
votes
5 answers

Random-access container that does not fit in memory?

I have an array of objects (say, images), which is too large to fit into memory (e.g. 40GB). But my code needs to be able to randomly access these objects at runtime. What is the best way to do this? From my code's point of view, it shouldn't…
Frank
  • 71
  • 2
7
votes
2 answers

In-memory version of Java's FileChannel

I'm in the process of making some changes to a library that I'm using. In order to reduce memory usage the library is writing its temporary data to disk instead of keeping it in memory. However, for my usage scenario it is more efficient to keep it…
Yrlec
  • 3,401
  • 6
  • 39
  • 75
6
votes
6 answers

CSV Random Access; C#

I have a 10GB CSV file which is essentially a huge square matrix. I am trying to write a function that can access a single cell of the matrix as efficiently as possible, ie matrix[12345,20000]. Given its size, it is obviously not possible to load…
user593062
  • 1,593
  • 4
  • 15
  • 24
6
votes
1 answer

java.io.RandomAccessFile Invalid Argument for large files on mac

I'm running a program which needs random access to a very large file (approximately 151 gigabytes). I've found that whenever it runs on one of the MacPro machines in the Orchard lab ( details at…
dspyz
  • 5,280
  • 2
  • 25
  • 63
6
votes
3 answers

Does Using a Pointer as a Container Iterator Violate the Standard

Angew made a comment that a vector using a raw pointer as it's iterator type was fine. That kinda threw me for a loop. I started researching it and found that the requirement for vector iterators was only that they are "Random Access Iterators" for…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
6
votes
3 answers

java.io.FileNotFoundException when using RandomAccessFile to create file

I'm encountering a FileNotFoundException when I try to make a file using RandomAccessFile: RandomAccessFile file = new RandomAccessFile("/test.jpg", "rw"); I don't now how to get around this. It's driving me nuts. Thanks
mlevit
  • 2,676
  • 10
  • 42
  • 50
6
votes
8 answers

Simple API for random access into a compressed data file

Please recommend a technology suitable for the following task. I have a rather big (500MB) data chunk, which is basically a matrix of numbers. The data entropy is low (it should be well-compressible) and the storage is expensive where it sits. What…
Pavel Radzivilovsky
  • 18,794
  • 5
  • 57
  • 67
6
votes
3 answers

How to return an object with multiple types

Let's take an example to make it easier. I build a list which the constructor takes an integer and a List. My list will contains all the elements of the given list multiplied by the integer. My list does not store the new elements but…
Happy
  • 1,815
  • 2
  • 18
  • 33
6
votes
7 answers

Any seekable compression library?

I'm looking for a general compression library that supports random access during decompression. I want to compress wikipedia into a single compressed format and at the same time I want to decompress/extract individual articles from it. Of course, I…
Wu Yongzheng
  • 1,707
  • 17
  • 23
6
votes
8 answers

Do any Java libraries provide a random access Queue implementation?

I'm implementing a sliding window over a stream of events, in Java. So I want a data structure which allows me to do the following: add to the end of the data structure when new events occur; remove from the start of the data structure when old…
Calum
  • 83
  • 1
  • 7
6
votes
2 answers

Multi-part gzip file random access (in Java)

This may fall in the realm of "not really feasible" or "not really worth the effort" but here goes. I'm trying to randomly access records stored inside a multi-part gzip file. Specifically, the files I'm interested in are compressed Heretrix Arc…
toluju
  • 4,097
  • 2
  • 23
  • 27
1 2
3
22 23