Greetings Dear experts, please can push on the right path. Actually the task:
I need to save the file as a "file array". For example, php - this is done very simply.
file.php :
<?php return array(1,2,3); Is there such a possibility in java?
Looked that the ability to save objects is available.
try (ObjectOutputStream ObjectOutputStream = new ObjectOutputStream(new FileOutputStream(FILE))) { ObjectOutputStream.writeObject(OBJECT); } After saving the object, to load, I do this:
final FileInputStream FileOutputStream = new FileInputStream(FILE); final ObjectInputStream ObjectInputStream = new ObjectInputStream(FileOutputStream); OBJECT = (ConcurrentHashMap) ObjectInputStream.readObject(); Is there a way to export / import arrays? As an array file, not an object.