D1Object in Morpho still uses byte array as data source
When morpho reads and saves the data package to the DataONE network, it handle the D1Objects. The entities, metadata and ore document will be transformed to the D1Object. However, the D1Object is still using the byt arrary as data source. That means we may put a big data file into the memory. This may cause some memory issue. The orignal design is that the D1Object will have a class attribute - a DataStore interface. The DataStore interface get and set methods. Those methods are handling InputStream and OutputStream, rather than byte array.
#1 Updated by ben leinfelder over 9 years ago
We discussed the following changes to D1Object.
-add: getDataInputStream() and setDataInputStream()
-modify: getData() and setData() to operate without actually storing the byte
-use the stream-based methods in Morpho.
D1Object will likely defer to the D1Client (with cache enabled) to retrieve the data input stream initially.
#2 Updated by Jing Tao over 9 years ago
I am thinking about the two methods we will add (in comment 1):
getDataInputStream() and setDataInputStream()
I think we should call getDataOutputStream()
So we should have a way to persistent the data in D1Object.
I believe the DataStore interface concept is still very useful. You may find it at;
DataStore has two methods:
OutputStream get(Identifier id);
void set(Identifier id, InputStream input);