avoid stream to array copying

This commit is contained in:
Egor.Ushakov
2017-01-11 13:15:21 +03:00
parent 0255eb3ba5
commit 6a09fe2524
16 changed files with 45 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@ package org.jetbrains.java.decompiler.struct.attr;
import org.jetbrains.java.decompiler.modules.decompiler.exps.AnnotationExprent;
import org.jetbrains.java.decompiler.struct.consts.ConstantPool;
import org.jetbrains.java.decompiler.util.DataInputFullStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -29,9 +29,7 @@ public class StructAnnotationParameterAttribute extends StructGeneralAttribute {
private List<List<AnnotationExprent>> paramAnnotations;
@Override
public void initContent(ConstantPool pool) throws IOException {
DataInputStream data = stream();
public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException {
int len = data.readUnsignedByte();
if (len > 0) {
paramAnnotations = new ArrayList<>(len);