Line 68... |
Line 68... |
}
|
}
|
|
|
/**
|
/**
|
* Send a list of bytes to the ICAP.
|
* Send a list of bytes to the ICAP.
|
* @param bytes
|
* @param bytes
|
|
* @throws FCPException
|
*/
|
*/
|
public void sendIcapData(java.util.List<Byte> bytes) {
|
public void sendIcapData(java.util.List<Byte> bytes) throws FCPException {
|
try {
|
|
this.fcpprotocol.send(this.icapWritePort, bytes, bytes.size());
|
this.fcpprotocol.send(this.icapWritePort, bytes, bytes.size());
|
} catch (FCPException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
}
|
}
|
|
|
/**
|
/**
|
* Send an array of byte to the ICAP.
|
* Send an array of byte to the ICAP.
|
* @param bytes
|
* @param bytes
|
Line 111... |
Line 107... |
int offset = 0;
|
int offset = 0;
|
int numRead = 0;
|
int numRead = 0;
|
while (offset < file.length()
|
while (offset < file.length()
|
&& (numRead = is.read(writereg, 0, 1024)) >= 0) {
|
&& (numRead = is.read(writereg, 0, 1024)) >= 0) {
|
offset += numRead;
|
offset += numRead;
|
try {
|
|
fcpprotocol.send(3, writereg, numRead);
|
fcpprotocol.send(3, writereg, numRead);
|
} catch (FCPException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
}
|
}
|
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
throw new FCPException("File not found: " + fileName);
|
throw new FCPException("File not found: " + fileName);
|
} catch (IOException e) {
|
} catch (IOException e) {
|
throw new FCPException("Error reading file: " + fileName);
|
throw new FCPException("Error reading file: " + fileName);
|