annotate src/goodjava/io/DataOutputStream.java @ 1648:224af797b1f9
Mainly small install script improvements
- Consistent usage of `$LUANHOME`, removed reliance on current directory.
- Made Luan build and install fine (on Linux) without requiring launching it via sudo. Only asks to elevate privileges if installation failed.
- Minor spelling mistake fix.
author |
Fox |
date |
Mon, 28 Mar 2022 18:00:12 +0200 |
parents |
aaac1d29edea |
children |
|
rev |
line source |
1492
|
1 package goodjava.io;
|
|
2
|
|
3 import java.io.OutputStream;
|
|
4 import java.io.IOException;
|
|
5 import java.nio.charset.StandardCharsets;
|
|
6
|
|
7
|
|
8 public class DataOutputStream extends java.io.DataOutputStream {
|
|
9
|
|
10 public DataOutputStream(OutputStream out) {
|
|
11 super(out);
|
|
12 }
|
|
13
|
|
14 public void writeString(String s) throws IOException {
|
|
15 byte[] a = s.getBytes(StandardCharsets.UTF_8);
|
|
16 writeInt(a.length);
|
|
17 write(a);
|
|
18 }
|
|
19 }
|