Use Java array syntax

This commit is contained in:
Simon Legner 2021-01-03 23:39:46 +01:00
parent b787a1fdaa
commit 712c8cacf7
5 changed files with 8 additions and 8 deletions

View File

@ -33,7 +33,7 @@ public abstract class BinaryParser implements BlockReaderAdapter {
private long lat_offset;
private long lon_offset;
protected int date_granularity;
private String strings[];
private String[] strings;
/** Take a Info protocol buffer containing a date and convert it into a java Date object */
protected Date getDate(Osmformat.Info info) {

View File

@ -34,7 +34,7 @@ public class StringTable {
private HashMap<String, Integer> counts;
private HashMap<String, Integer> stringmap;
private String set[];
private String[] set;
public void incr(String s) {
counts.merge(s, 1, Integer::sum);

View File

@ -65,7 +65,7 @@ public class FileBlock extends FileBlockBase {
Deflater deflater = new Deflater();
deflater.setInput(data.toByteArray());
deflater.finish();
byte out[] = new byte[size];
byte[] out = new byte[size];
deflater.deflate(out);
if (!deflater.finished()) {

View File

@ -50,7 +50,7 @@ public class FileBlockHead extends FileBlockReference {
throw new FileFormatException("Unexpectedly long header "+MAX_HEADER_SIZE+ " bytes. Possibly corrupt file.");
}
byte buf[] = new byte[headersize];
byte[] buf = new byte[headersize];
datinput.readFully(buf);
// System.out.format("Read buffer for header of %d bytes\n",buf.length);
Fileformat.BlobHeader header = Fileformat.BlobHeader
@ -90,7 +90,7 @@ public class FileBlockHead extends FileBlockReference {
*/
FileBlock readContents(InputStream input) throws IOException {
DataInputStream datinput = new DataInputStream(input);
byte buf[] = new byte[getDatasize()];
byte[] buf = new byte[getDatasize()];
datinput.readFully(buf);
return parseData(buf);
}

View File

@ -43,13 +43,13 @@ public class FileBlockPosition extends FileBlockBase {
}
/** Parse out and decompress the data part of a fileblock helper function. */
FileBlock parseData(byte buf[]) throws InvalidProtocolBufferException {
FileBlock parseData(byte[] buf) throws InvalidProtocolBufferException {
FileBlock out = FileBlock.newInstance(type, null, indexdata);
Fileformat.Blob blob = Fileformat.Blob.parseFrom(buf);
if (blob.hasRaw()) {
out.data = blob.getRaw();
} else if (blob.hasZlibData()) {
byte buf2[] = new byte[blob.getRawSize()];
byte[] buf2 = new byte[blob.getRawSize()];
Inflater decompresser = new Inflater();
decompresser.setInput(blob.getZlibData().toByteArray());
// decompresser.getRemaining();
@ -85,7 +85,7 @@ public class FileBlockPosition extends FileBlockBase {
public FileBlock read(InputStream input) throws IOException {
if (input instanceof FileInputStream) {
((FileInputStream) input).getChannel().position(data_offset);
byte buf[] = new byte[getDatasize()];
byte[] buf = new byte[getDatasize()];
(new DataInputStream(input)).readFully(buf);
return parseData(buf);
} else {