<commit_before>/*
 ** 2013 July 27
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.unity.io;

import info.ata4.unity.struct.Struct;
import info.ata4.util.io.DataInputReader;
import java.io.IOException;

/**
 *
 * @author <NAME> <barracuda415 at yahoo.de>
 */
public class AssetInput {
    
    private static final int ALIGNMENT = 4;
    
    private final DataInputReader in;
    private int bytes;

    public AssetInput(DataInputReader in) {
        this.in = in;
    }
    
    public byte readByte() throws IOException {
        bytes++;
        return in.readByte();
    }
    
    public int readUnsignedByte() throws IOException {
        bytes++;
        return in.readUnsignedByte();
    }

    public boolean readBoolean() throws IOException {
        bytes++;
        return in.readBoolean();
    }
    
    public int readInt() throws IOException {
        align();
        return in.readInt();
    }
    
    public long readUnsignedInt() throws IOException {
        align();
        return in.readUnsignedInt();
    }
    
    public long readLong() throws IOException {
        align();
        return in.readLong();
    }
    
    public float readFloat() throws IOException {
        align();
        return in.readFloat();
    }
    
    public double readDouble() throws IOException {
        align();
        return in.readDouble();
    }
    
    public short readShort() throws IOException {
        align();
        return in.readShort();
    }

    public int readUnsignedShort() throws IOException {
        align();
        return in.readUnsignedShort();
    }
    
    public byte[] readByteArray(int len) throws IOException {
        align();
        byte[] data = new byte[len];
        in.readFully(data);
        bytes = len;
        align();
        return data;
    }
    
    public byte[] readByteArray() throws IOException {
        align();
        int len = in.readInt();
        return readByteArray(len);
    }
    
    public String readString() throws IOException {<commit_msg>Compacted code and reduced align() calls for readByteArray()<commit_after>/*
 ** 2013 July 27
 **
 ** The author disclaims copyright to this source code.  In place of
 ** a legal notice, here is a blessing:
 **    May you do good and not evil.
 **    May you find forgiveness for yourself and forgive others.
 **    May you share freely, never taking more than you give.
 */
package info.ata4.unity.io;

import info.ata4.unity.struct.Struct;
import info.ata4.util.io.DataInputReader;
import java.io.IOException;

/**
 *
 * @author <NAME> <barracuda415 at yahoo.de>
 */
public class AssetInput {
    
    private static final int ALIGNMENT = 4;
    
    private final DataInputReader in;
    private int bytes;

    public AssetInput(DataInputReader in) {
        this.in = in;
    }
    
    public byte readByte() throws IOException {
        bytes++;
        return in.readByte();
    }
    
    public int readUnsignedByte() throws IOException {
        bytes++;
        return in.readUnsignedByte();
    }

    public boolean readBoolean() throws IOException {
        bytes++;
        return in.readBoolean();
    }
    
    public int readInt() throws IOException {
        align();
        return in.readInt();
    }
    
    public long readUnsignedInt() throws IOException {
        align();
        return in.readUnsignedInt();
    }
    
    public long readLong() throws IOException {
        align();
        return in.readLong();
    }
    
    public float readFloat() throws IOException {
        align();
        return in.readFloat();
    }
    
    public double readDouble() throws IOException {
        align();
        return in.readDouble();
    }
    
    public short readShort() throws IOException {
        align();
        return in.readShort();
    }

    public int readUnsignedShort() throws IOException {
        align();
        return in.readUnsignedShort();
    }
    
    public byte[] readByteArray() throws IOException {
        int len = in.readInt();
        byte[] data = new byte[len];
        in.readFully(data);
        bytes = len;
        align();
        return data;
    }
    
    public String readString() throws IOException {
{'fraction_non_alphanumeric': 0.09867385929422343, 'fraction_numerical': 0.005844009889862891, 'mean_word_length': 2.158268275372605, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4109639', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1189, 'n_words': 387}