1 47 48 package com.lowagie.text.rtf.document.output; 49 50 import java.io.OutputStream ; 51 52 62 public final class RtfNilOutputStream extends OutputStream  63 { 64 private long size = 0; 65 66 public RtfNilOutputStream() 67 { 68 } 69 70 public long getSize() 71 { 72 return(size); 73 } 74 75 public void write(int b) 76 { 77 size++; 78 } 79 public void write(byte[] b, int off, int len) 80 { 81 if (b == null) { 82 throw new NullPointerException (); 83 } else if ((off < 0) || (off > b.length) || (len < 0) || 84 ((off + len) > b.length) || ((off + len) < 0)) { 85 throw new IndexOutOfBoundsException (); 86 } 87 size += len; 88 } 89 } | Popular Tags |