API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.xml.crypto. OctetStreamData View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

/*
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 *
 * @author Sean Mullan
 * @author JSR 105 Expert Group
 */
/*
 * $Id: OctetStreamData.java,v 1.3 2005/05/10 15:47:42 mullan Exp $
 */
package javax.xml.crypto;

import java.io.InputStream;

/**
 * A representation of a <code>Data</code> type containing an octet stream.
 *
 * @since 1.6
 */
public class OctetStreamData implements Data {
  
    private InputStream octetStream;
    private String uri;
    private String mimeType;

    /**
     * Creates a new <code>OctetStreamData</code>.
     *
     * @param octetStream the input stream containing the octets
     * @throws NullPointerException if <code>octetStream</code> is 
     *    <code>null</code>
     */
    public OctetStreamData(InputStream octetStream) {
	if (octetStream == null) {
	    throw new NullPointerException("octetStream is null");
	}
	this.octetStream = octetStream;
    }

    /**
     * Creates a new <code>OctetStreamData</code>.
     *
     * @param octetStream the input stream containing the octets
     * @param uri the URI String identifying the data object (may be 
     *    <code>null</code>) 
     * @param mimeType the MIME type associated with the data object (may be 
     *    <code>null</code>) 
     * @throws NullPointerException if <code>octetStream</code> is 
     *    <code>null</code>
     */
    public OctetStreamData(InputStream octetStream, String uri, 
	String mimeType) {
	if (octetStream == null) {
	    throw new NullPointerException("octetStream is null");
	}
	this.octetStream = octetStream;
	this.uri = uri;
	this.mimeType = mimeType;
    }

    /**
     * Returns the input stream of this <code>OctetStreamData</code>.
     *
     * @return the input stream of this <code>OctetStreamData</code>.
     */
    public InputStream getOctetStream() {
	return octetStream;
    }

    /**
     * Returns the URI String identifying the data object represented by this
     * <code>OctetStreamData</code>.
     *
     * @return the URI String or <code>null</code> if not applicable
     */
    public String getURI() {
	return uri;
    }

    /**
     * Returns the MIME type associated with the data object represented by this
     * <code>OctetStreamData</code>.
     *
     * @return the MIME type or <code>null</code> if not applicable
     */
    public String getMimeType() {
	return mimeType;
    }
}

Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar