package com.everis.imagesources; import java.io.ByteArrayInputStream; import java.io.IOException; import com.abbyy.FCEngine.*; public class streamSource2 implements IReadStream{ private ByteArrayInputStream reader = null; public streamSource2(byte[] image) { this.reader = new ByteArrayInputStream(image); System.out.println("TAMAŅO "+image.length); } @Override public void Close() { try { reader.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public int Read(Ref data, int count) { System.out.println("READ BYTES "); System.out.println(System.getProperty("sun.arch.data.model")); data.set(new byte[count]); int readBytes = reader.read(data.get(), 0, count); System.out.println("READED "+readBytes); return readBytes; } }