Source code: com/traxel/io/CopyrightedOutputStream.java
1 /* $Id: CopyrightedOutputStream.java,v 1.1 2001/03/22 12:03:45 cvsbob Exp $ */
2
3 package com.traxel.io;
4
5 import java.io.IOException;
6 import java.io.OutputStream;
7 import java.io.FilterOutputStream;
8 import java.io.File;
9 import java.io.RandomAccessFile;
10
11 /**
12 * @author Josh Flowers
13 * @author Tom Moore
14 * @author Robert Bushman
15 */
16
17 public class CopyrightedOutputStream extends FilterOutputStream {
18
19 private long _readerIndex = (long)0;
20 private RandomAccessFile _file = null;
21 private StreamMixer _mixer;
22
23 //---------------------------------------------------------
24 // CONSTRUCTORS
25 // -------------------------------------------------------
26
27 /**
28 * This constructor uses the default copyrighted text.
29 * <b>WARNING:</b> Using this constructor may render
30 * this stream not useable to gain protection under
31 * the DMCA. The DMCA requires that a technological
32 * measure "effectively control access". If you are
33 * using a text string that is published under the
34 * GPL, it might be impossible to argue that your
35 * program is effectively controlling access.
36 */
37 public CopyrightedOutputStream( OutputStream out ) {
38 super( out );
39 _mixer = new StreamMixerSimple();
40 }
41
42 // --------------------------------------------------------
43 // OUTPUTSTREAM IMPLEMENTATION
44 // --------------------------------------------------------
45
46 public void write( int aByte ) throws IOException {
47 _mixer.writeTo( out, aByte );
48 }
49 }