1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.internal.storage.file;
12
13 import java.io.DataOutput;
14 import java.io.IOException;
15 import java.io.OutputStream;
16
17 import org.eclipse.jgit.util.NB;
18
19
20
21
22
23
24
25 class SimpleDataOutput implements DataOutput {
26 private final OutputStream fd;
27
28 private final byte[] buf = new byte[8];
29
30 SimpleDataOutput(OutputStream fd) {
31 this.fd = fd;
32 }
33
34
35 @Override
36 public void writeShort(int v) throws IOException {
37 NB.encodeInt16(buf, 0, v);
38 fd.write(buf, 0, 2);
39 }
40
41
42 @Override
43 public void writeInt(int v) throws IOException {
44 NB.encodeInt32(buf, 0, v);
45 fd.write(buf, 0, 4);
46 }
47
48
49 @Override
50 public void writeLong(long v) throws IOException {
51 NB.encodeInt64(buf, 0, v);
52 fd.write(buf, 0, 8);
53 }
54
55
56 @Override
57 public void write(int b) throws IOException {
58 throw new UnsupportedOperationException();
59 }
60
61
62 @Override
63 public void write(byte[] b) throws IOException {
64 throw new UnsupportedOperationException();
65 }
66
67
68 @Override
69 public void write(byte[] b, int off, int len) throws IOException {
70 throw new UnsupportedOperationException();
71 }
72
73
74 @Override
75 public void writeBoolean(boolean v) throws IOException {
76 throw new UnsupportedOperationException();
77 }
78
79
80 @Override
81 public void writeByte(int v) throws IOException {
82 throw new UnsupportedOperationException();
83 }
84
85
86 @Override
87 public void writeChar(int v) throws IOException {
88 throw new UnsupportedOperationException();
89 }
90
91
92 @Override
93 public void writeFloat(float v) throws IOException {
94 throw new UnsupportedOperationException();
95 }
96
97
98 @Override
99 public void writeDouble(double v) throws IOException {
100 throw new UnsupportedOperationException();
101 }
102
103
104 @Override
105 public void writeBytes(String s) throws IOException {
106 throw new UnsupportedOperationException();
107 }
108
109
110 @Override
111 public void writeChars(String s) throws IOException {
112 throw new UnsupportedOperationException();
113 }
114
115
116 @Override
117 public void writeUTF(String s) throws IOException {
118 throw new UnsupportedOperationException();
119 }
120 }