OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [java/] [src/] [edu/] [byu/] [cc/] [plieber/] [fpgaenet/] [icapif/] [IcapInterface.java] - Diff between revs 2 and 7

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 7
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);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.