- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevice.java
More file actions
Latest commit
44 lines (37 loc) · 1.05 KB
/
Copy pathDevice.java
File metadata and controls
44 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
importjava.util.Optional;
publicinterfaceDevice {
publicstaticfinalintDEVICE_COUNT = 10; // The max amount of devices this OS can hold.
/**
* Opens the desired Device.
*
* @param device A string corresponding to the desired Device.
*/
Optional<Integer> open(Strings);
/**
* Reads from the desired Device.
*
* @param id The FID of the desired Device.
* @param size The amount of data to be read.
*/
Optional<byte[]> read(intid, intsize);
/**
* Moves the curser within the desired Device.
*
* @param id The FID of the desired Device.
* @param to The distance to move the curser.
*/
voidseek(intid, intto);
/**
* Writes to the desired Device.
*
* @param id The FID of the desired Device.
* @param data The data to be writen to the Device.
*/
Optional<Integer> write(intid, byte[] data);
/**
* Closes the desired Device.
*
* @param id The FID of the desired Device.
*/
voidclose(intid);
}