2 * Svjatoslav Commons - shared library of common functionality. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
5 package eu.svjatoslav.commons.data;
7 import java.io.DataOutputStream;
8 import java.io.IOException;
9 import java.io.OutputStream;
10 import java.util.List;
12 public class EnhancedDataOutputStream extends DataOutputStream {
14 public EnhancedDataOutputStream(final OutputStream out) {
18 public void writeIntegerList(final List<Integer> list) throws IOException {
19 writeInt(list.size());
21 for (final Integer integer : list)
25 public void writeString(final String string) throws IOException {
31 final byte[] bytes = string.getBytes("UTF-8");
33 writeInt(bytes.length);