X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fdata%2FEnhancedDataOutputStream.java;h=7d936e2a6790ae0451ee1bff0b31b805871f033f;hb=0bdce2e2b2c16cc9576e8d96c67ce2830c8b0afc;hp=2598215a0a69e52e94dc38f38bb689328f490100;hpb=26f09b1ebcafae67855b55ad588d5332a107d202;p=svjatoslav_commons.git diff --git a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java old mode 100644 new mode 100755 index 2598215..7d936e2 --- a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataOutputStream.java @@ -1,12 +1,7 @@ /* - * Svjatoslav Commons - shared library of common functionality. - * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. + * Svjatoslav Commons - shared library of common functionality. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. */ - package eu.svjatoslav.commons.data; import java.io.DataOutputStream; @@ -16,27 +11,27 @@ import java.util.List; public class EnhancedDataOutputStream extends DataOutputStream { - public EnhancedDataOutputStream(final OutputStream out) { - super(out); - } + public EnhancedDataOutputStream(final OutputStream out) { + super(out); + } - public void writeIntegerList(final List list) throws IOException { - writeInt(list.size()); + public void writeIntegerList(final List list) throws IOException { + writeInt(list.size()); - for (final Integer integer : list) - writeInt(integer); - } + for (final Integer integer : list) + writeInt(integer); + } - public void writeString(final String string) throws IOException { - if (string == null) { - writeInt(-1); - return; - } + public void writeString(final String string) throws IOException { + if (string == null) { + writeInt(-1); + return; + } - final byte[] bytes = string.getBytes(); + final byte[] bytes = string.getBytes("UTF-8"); - writeInt(bytes.length); - write(bytes); - } + writeInt(bytes.length); + write(bytes); + } }