If slice size is greater than internal buffer size (16K), the result is an FPLibraryException wrapping the following IndexOutOfBoundException
java.lang.IndexOutOfBoundsException at java.io.RandomAccessFile.readBytes(Native Method) at java.io.RandomAccessFile.read(RandomAccessFile.java:307) at com.filepool.fplibrary.FPFileInputStream.read(Unknown Source) at it.txt.polymedia.feeds.actions.video.CenteraArchiver$MonitoredFileInputStream.read(CenteraArchiver.java:845) at com.filepool.natives.FPLibraryNative.FPTag_BlobWritePartial(Native Method) at com.filepool.fplibrary.FPTag.BlobWritePartial(Unknown Source)
Inserting a breakpoint in method read of class RandomAccessFile, we noted a call with the following parameters:
RandomAccessFile.read(buffer, 100000, 16384);
Where buffer is a byte array of 16384 elements (the internal buffer, I suppose) Our suspect is that FPFileInputStream class store the offset received in the constructor and passes it to read method (Other test with different offset values confirm this suspect). The problem is that the offset parameter of read method refer to the buffer and not to the file!!!
Is it a bug of FPFileInputStream class or there is something wrong in our code? Can somebody help?
P.S.: I have found another topic on this forum for the same problem with title blobwritepartial problem and last post date 16/03/2007, but it doesn't solved.