1 50 51 package org.openlaszlo.iv.flash.parser; 52 53 import org.openlaszlo.iv.flash.util.*; 54 import java.io.*; 55 56 public final class DataMarker { 57 58 public byte[] buffer; 59 public int start; 60 public int end; 61 62 public DataMarker() {} 63 64 public DataMarker( byte[] buffer, int start, int end ) { 65 this.buffer = buffer; 66 this.start = start; 67 this.end = end; 68 } 69 70 public int length() { 71 return end-start; 72 } 73 74 public void write( FlashBuffer fob ) { 75 fob.writeArray(buffer, start, end-start); 76 } 77 78 public DataMarker getCopy() { 79 DataMarker dm = new DataMarker(); 80 dm.buffer = buffer; 81 dm.start = start; 82 dm.end = end; 83 return dm; 84 } 85 86 public InputStream getInputStream() { 87 return new ByteArrayInputStream(buffer,start,end-start); 88 } 89 90 public void printContent( PrintStream out ) { 91 Util.dump(buffer, start, length(), out); 92 } 93 } 94 | Popular Tags |