2 * Svjatoslav Commons - shared library of common functionality.
3 * Copyright ©2012-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 3 of the GNU Lesser General Public License
7 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.commons.data;
12 import java.io.DataOutputStream;
13 import java.io.IOException;
14 import java.io.OutputStream;
15 import java.util.List;
17 public class EnhancedDataOutputStream extends DataOutputStream {
19 public EnhancedDataOutputStream(final OutputStream out) {
23 public void writeIntegerList(final List<Integer> list) throws IOException {
24 writeInt(list.size());
26 for (final Integer integer : list)
30 public void writeString(final String string) throws IOException {
36 final byte[] bytes = string.getBytes("UTF-8");
38 writeInt(bytes.length);