1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs.provider;
18
19 import org.apache.commons.vfs.RandomAccessContent;
20 import org.apache.commons.vfs.util.RandomAccessMode;
21
22 import java.io.IOException;
23
24 /***
25 * Implements the DataOutput part of the RandomAccessContent interface and throws
26 * UnsupportedOperationException if one of those methods are called.
27 * (for read-only random access implementations)
28 *
29 * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
30 * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
31 */
32 public abstract class AbstractRandomAccessContent implements RandomAccessContent
33 {
34 private final RandomAccessMode mode;
35
36 protected AbstractRandomAccessContent(final RandomAccessMode mode)
37 {
38 this.mode = mode;
39 }
40
41 public void writeDouble(double v) throws IOException
42 {
43 throw new UnsupportedOperationException();
44 }
45
46 public void writeFloat(float v) throws IOException
47 {
48 throw new UnsupportedOperationException();
49 }
50
51 public void write(int b) throws IOException
52 {
53 throw new UnsupportedOperationException();
54 }
55
56 public void writeByte(int v) throws IOException
57 {
58 throw new UnsupportedOperationException();
59 }
60
61 public void writeChar(int v) throws IOException
62 {
63 throw new UnsupportedOperationException();
64 }
65
66 public void writeInt(int v) throws IOException
67 {
68 throw new UnsupportedOperationException();
69 }
70
71 public void writeShort(int v) throws IOException
72 {
73 throw new UnsupportedOperationException();
74 }
75
76 public void writeLong(long v) throws IOException
77 {
78 throw new UnsupportedOperationException();
79 }
80
81 public void writeBoolean(boolean v) throws IOException
82 {
83 throw new UnsupportedOperationException();
84 }
85
86 public void write(byte b[]) throws IOException
87 {
88 throw new UnsupportedOperationException();
89 }
90
91 public void write(byte b[], int off, int len) throws IOException
92 {
93 throw new UnsupportedOperationException();
94 }
95
96 public void writeBytes(String s) throws IOException
97 {
98 throw new UnsupportedOperationException();
99 }
100
101 public void writeChars(String s) throws IOException
102 {
103 throw new UnsupportedOperationException();
104 }
105
106 public void writeUTF(String str) throws IOException
107 {
108 throw new UnsupportedOperationException();
109 }
110
111 /***
112 * @deprecated see {@link java.io.DataInputStream#readLine()}
113 */
114 public String readLine() throws IOException
115 {
116 throw new UnsupportedOperationException("deprecated");
117 }
118 }