MCPcopy Create free account
hub / github.com/ReadyTalk/avian / DataOutputStream

Class DataOutputStream

classpath/java/io/DataOutputStream.java:13–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11package java.io;
12
13public class DataOutputStream extends OutputStream implements DataOutput {
14 private OutputStream out;
15
16 public DataOutputStream(OutputStream out) {
17 this.out = out;
18 }
19
20 public void close() throws IOException {
21 out.close();
22 }
23
24 public void flush() throws IOException {
25 out.flush();
26 }
27
28 public void write(byte[] buffer) throws IOException {
29 out.write(buffer);
30 }
31
32 public void write(byte[] buffer, int offset, int length) throws IOException {
33 out.write(buffer, offset, length);
34 }
35
36 public void write(int b) throws IOException {
37 out.write(b);
38 }
39
40 public void writeBoolean(boolean b) throws IOException {
41 writeByte(b ? 1 : 0);
42 }
43
44 public void writeByte(int b) throws IOException {
45 out.write(b);
46 }
47
48 public void writeShort(int s) throws IOException {
49 write((byte)(s >> 8));
50 write((byte)s);
51 }
52
53 public void writeInt(int i) throws IOException {
54 write((byte)(i >> 24));
55 write((byte)(i >> 16));
56 write((byte)(i >> 8));
57 write((byte)i);
58 }
59
60 public void writeFloat(float f) throws IOException {
61 writeInt(Float.floatToIntBits(f));
62 }
63
64 public void writeDouble(double d) throws IOException {
65 writeLong(Double.doubleToLongBits(d));
66 }
67
68 public void writeLong(long l) throws IOException {
69 write((byte)(l >> 56));
70 write((byte)(l >> 48));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected