X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fdata%2FEnhancedDataInputStream.java;h=bc77226acca58278b79e5ef3d0b39283575df2ee;hb=443c6a564efa9f5868fd81c0db23a480cbe3cab4;hp=15a0e8c22146e06fffb27ad805929c09b0b99a91;hpb=b34ba4499cfbca09bc794a810e460bf1c86dcd34;p=svjatoslav_commons.git diff --git a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java index 15a0e8c..bc77226 100755 --- a/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java +++ b/src/main/java/eu/svjatoslav/commons/data/EnhancedDataInputStream.java @@ -1,7 +1,7 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License * or later as published by the Free Software Foundation. @@ -17,31 +17,31 @@ import java.util.List; public class EnhancedDataInputStream extends DataInputStream { - public EnhancedDataInputStream(final InputStream in) { - super(in); - } + public EnhancedDataInputStream(final InputStream in) { + super(in); + } - public List readIntegerList() throws IOException { - final int length = readInt(); + public List readIntegerList() throws IOException { + final int length = readInt(); - final List result = new ArrayList(); + final List result = new ArrayList<>(); - for (int i = 0; i < length; i++) - result.add(readInt()); + for (int i = 0; i < length; i++) + result.add(readInt()); - return result; - } + return result; + } - public String readString() throws IOException { + public String readString() throws IOException { - final int length = readInt(); - if (length == -1) - return null; + final int length = readInt(); + if (length == -1) + return null; - final byte[] bytes = new byte[length]; - readFully(bytes); + final byte[] bytes = new byte[length]; + readFully(bytes); - return new String(bytes, "UTF-8"); - } + return new String(bytes, "UTF-8"); + } }