FileRegionDataSource¶
-
public class
FileRegionDataSource
extends FileDataSource¶ ByteBufferDataSource is an implementation of the javax.activation.DataSource that represents a data source of a region in the file. Creation Date: 2/11/2006
Author: Twinsen Tsang
Methods¶
getByteBuffer¶
-
public ByteBuffer
getByteBuffer
()¶ This method will return an ByteBuffer representing the the data region and will throw an IOException if it can not do so or OutOfMemory error. For OutOfMemory error in direct memory usage, it’s still an issue in Java. http://bugs.sun.com/view_bug.do?bug_id=5025281 Properly reuse of the memory and set runtime parameter may solve the problem.
See also:
java.nio.channels.FileChannel
getInputStream¶
-
public InputStream
getInputStream
()¶ This method will return an InputStream representing the the data and will throw an IOException if it can not do so. This method will return a new instance of ByteBufferInputStream with the direct byte buffer inside for each invocation.
See also:
java.nio.channels.FileChannel
,hk.hku.cecid.edi.sfrm.io.ByteBufferInputStream
getOutputStream¶
-
public OutputStream
getOutputStream
()¶ This method always throw IO exception.
Throws: - IOException – as output stream is not supported by this data source.