java/src/org/openantivirus/engine/censor PositionFoundEvent.java,1.1,1.2
Kurt Huwig <[email protected]> Wed, 19 May 2004 08:09:52 +0000
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/java/src/org/openantivirus/engine/censor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8913/src/org/openantivirus/engine/censor
Modified Files:
PositionFoundEvent.java
Log Message:
Optimized memory trashing
Index: PositionFoundEvent.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/censor/PositionFoundEvent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PositionFoundEvent.java 19 May 2004 07:33:41 -0000 1.1
+++ PositionFoundEvent.java 19 May 2004 08:09:49 -0000 1.2
@@ -36,11 +36,15 @@
* @version $Revision$
*/
public class PositionFoundEvent {
- public final byte[] buffer;
- public final VfsEntry entry;
- public final long fileOffset;
- public final int bufferOffset, length, prefix, suffix;
+ public byte[] buffer;
+ public VfsEntry entry;
+ public long fileOffset;
+ public int bufferOffset, length, prefix, suffix;
+ public PositionFoundEvent() {
+ // nothing
+ }
+
/**
* @param entry the entry containing the position
* @param fileOffset offset within the file
@@ -54,6 +58,23 @@
long fileOffset,
byte[] buffer, int bufferOffset, int length,
int prefix, int suffix) {
+ setValues(entry, fileOffset, buffer, bufferOffset, length, prefix,
+ suffix);
+ }
+
+ /**
+ * @param entry the entry containing the position
+ * @param fileOffset offset within the file
+ * @param buffer the (ring) buffer containing the string found
+ * @param bufferOffset offset of the start of the string within the buffer
+ * @param length length of the string found
+ * @param prefixLength number of valid bytes before the offset byte
+ * @param suffixLength number of valid bytes after the offset byte
+ */
+ public void setValues(VfsEntry entry,
+ long fileOffset,
+ byte[] buffer, int bufferOffset, int length,
+ int prefix, int suffix) {
this.entry = entry;
this.fileOffset = fileOffset;
this.buffer = buffer;
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click