Android Open Source - non Non Buffer






From Project

Back to project page non.

License

The source code is released under:

MIT License

If you think the Android project non listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package non;
//from ww  w  .  j  a va  2 s.  c om
import java.io.*;

public class NonBuffer {
    private ByteArrayInputStream inBytes;
    private ByteArrayOutputStream outBytes;
    private DataInputStream in;
    private DataOutputStream out;

    public NonBuffer() {
        outBytes = new ByteArrayOutputStream();
        out = new DataOutputStream(outBytes);
    }

    public NonBuffer(byte[] data) {
        inBytes = new ByteArrayInputStream(data);
        in = new DataInputStream(inBytes);
    }

    public NonBuffer write(byte[] data) throws IOException {
        out.write(data);
        return this;
    }

    public NonBuffer writeBoolean(boolean val) throws IOException {
        out.writeBoolean(val);
        return this;
    }

    public NonBuffer writeByte(int val) throws IOException {
        out.writeByte(val);
        return this;
    }

    public NonBuffer writeFloat(float val) throws IOException {
        out.writeFloat(val);
        return this;
    }

    public NonBuffer writeInt(int val) throws IOException {
        out.writeInt(val);
        return this;
    }

    public NonBuffer writeLong(long val) throws IOException {
        out.writeLong(val);
        return this;
    }

    public NonBuffer writeString(String val) throws IOException {
        out.writeUTF(val);
        return this;
    }

    public byte[] read() {
        return outBytes.toByteArray();
    }

    public boolean readBoolean() throws IOException {
        return in.readBoolean();
    }

    public byte readByte() throws IOException {
        return in.readByte();
    }

    public float readFloat() throws IOException {
        return in.readFloat();
    }

    public int readInt() throws IOException {
        return in.readInt();
    }

    public long readLong() throws IOException {
        return in.readLong();
    }

    public String readString() throws IOException {
        return in.readUTF();
    }
}




Java Source Code List

%PACKAGE%.android.AndroidLauncher.java
%PACKAGE%.desktop.DesktopLauncher.java
%PACKAGE%.ios.IOSLauncher.java
launcher.Main.java
non.InputHandle.java
non.Line.java
non.NonBuffer.java
non.Non.java
non.Quad.java
non.languages.Language.java
non.languages.javascript.java
non.languages.lua.java
non.plugins.Plugin.java
non.plugins.audio.java
non.plugins.graphics.java
non.plugins.input.java
non.plugins.lights.java
non.plugins.math.java
non.plugins.network.java
non.plugins.non.java
non.plugins.physics.java