public final class AutoBuffer
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Class and Description |
---|---|
static class |
AutoBuffer.AutoBufferException |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
sourceName |
static int |
TCP_BUF_SIZ |
Constructor and Description |
---|
AutoBuffer()
Write to an ever-expanding byte[].
|
AutoBuffer(byte[] buf)
Read from a fixed byte[]; should not be closed.
|
AutoBuffer(java.nio.channels.ByteChannel sock)
Incoming TCP request.
|
AutoBuffer(java.nio.channels.ByteChannel sock,
java.net.InetAddress remoteAddress,
short timestamp)
Incoming TCP request.
|
AutoBuffer(java.nio.channels.FileChannel fc,
boolean read,
byte persist)
Spill-to/from-disk request.
|
AutoBuffer(java.io.InputStream is)
Read from a persistent Stream (including all TypeMap info) into same
exact rev of H2O).
|
AutoBuffer(java.io.InputStream is,
java.lang.String[] typeMap) |
AutoBuffer(int len)
Write to a known sized byte[].
|
AutoBuffer(java.io.OutputStream os,
boolean persist)
Write to a persistent Stream, including all TypeMap info to allow later
reloading (by the same exact rev of H2O).
|
Modifier and Type | Method and Description |
---|---|
byte[] |
buf() |
byte[] |
bufClose() |
void |
close() |
static BootstrapFreezable<?> |
deserializeBootstrapFreezable(byte[] bytes) |
AutoBuffer |
flipForReading() |
<T extends Freezable> |
get() |
<T extends Freezable> |
get(java.lang.Class<T> tc) |
byte |
get1() |
int |
get1U() |
char |
get2() |
short |
get2s() |
int |
get3() |
int |
get4() |
float |
get4f() |
long |
get8() |
double |
get8d() |
<T extends Freezable> |
getA(java.lang.Class<T> tc) |
byte[] |
getA1() |
byte[] |
getA1(int len) |
short[] |
getA2() |
int[] |
getA4() |
float[] |
getA4f() |
long[] |
getA8() |
double[] |
getA8d() |
<T extends Freezable> |
getAA(java.lang.Class<T> tc) |
byte[][] |
getAA1() |
short[][] |
getAA2() |
int[][] |
getAA4() |
float[][] |
getAA4f() |
long[][] |
getAA8() |
double[][] |
getAA8d() |
<T extends Freezable> |
getAAA(java.lang.Class<T> tc) |
int[][][] |
getAAA4() |
long[][][] |
getAAA8() |
double[][][] |
getAAA8d() |
<T> T[][][] |
getAAASer(java.lang.Class<T> tc) |
<T> T[][] |
getAASer(java.lang.Class<T> tc) |
java.lang.String[][] |
getAAStr() |
<E extends java.lang.Enum> |
getAEnum(E[] values) |
<T> T[] |
getASer(java.lang.Class<T> tc) |
java.lang.String[] |
getAStr() |
boolean[] |
getAZ() |
<E extends java.lang.Enum> |
getEnum(E[] values) |
int |
getInt() |
Keyed |
getKey(Futures fs) |
Keyed |
getKey(Key k,
Futures fs) |
java.lang.Object |
getSer() |
<T> T |
getSer(java.lang.Class<T> tc) |
java.lang.String |
getStr() |
java.lang.String |
getStr(int off,
int len) |
boolean |
getZ() |
boolean |
isClosed() |
static java.lang.Object |
javaSerializeReadPojo(byte[] bytes) |
static byte[] |
javaSerializeWritePojo(java.lang.Object o) |
int |
position() |
AutoBuffer |
position(int p) |
AutoBuffer |
put(Freezable f) |
AutoBuffer |
put1(int b) |
AutoBuffer |
put2(char c) |
AutoBuffer |
put2(short s) |
AutoBuffer |
put2s(short s) |
AutoBuffer |
put3(int x) |
AutoBuffer |
put4(int i) |
AutoBuffer |
put4f(float f) |
AutoBuffer |
put8(long l) |
AutoBuffer |
put8d(double d) |
AutoBuffer |
putA(Freezable[] fs) |
AutoBuffer |
putA1(byte[] ary) |
AutoBuffer |
putA1(byte[] ary,
int length) |
AutoBuffer |
putA1(byte[] ary,
int sofar,
int length) |
AutoBuffer |
putA4(int[] ary) |
AutoBuffer |
putA4f(float[] ary) |
AutoBuffer |
putA8(long[] ary) |
AutoBuffer |
putA8d(double[] ary) |
AutoBuffer |
putAA(Freezable[][] fs) |
AutoBuffer |
putAA1(byte[][] ary) |
AutoBuffer |
putAA4(int[][] ary) |
AutoBuffer |
putAA4f(float[][] ary) |
AutoBuffer |
putAA8(long[][] ary) |
AutoBuffer |
putAA8d(double[][] ary) |
AutoBuffer |
putAAA(Freezable[][][] fs) |
AutoBuffer |
putAAA4(int[][][] ary) |
AutoBuffer |
putAAA8(long[][][] ary) |
AutoBuffer |
putAAA8d(double[][][] ary) |
AutoBuffer |
putAAASer(java.lang.Object[][][] fs) |
AutoBuffer |
putAASer(java.lang.Object[][] fs) |
AutoBuffer |
putAAStr(java.lang.String[][] fs) |
AutoBuffer |
putAEnum(java.lang.Enum[] enums) |
AutoBuffer |
putASer(java.lang.Object[] fs) |
AutoBuffer |
putAStr(java.lang.String[] fs) |
AutoBuffer |
putAZ(boolean[] ary) |
AutoBuffer |
putEnum(java.lang.Enum x) |
AutoBuffer |
putInt(int x) |
AutoBuffer |
putJNULL() |
AutoBuffer |
putJSON(Freezable ice) |
AutoBuffer |
putJSON(java.lang.String name,
Freezable f) |
AutoBuffer |
putJSON1(byte b) |
AutoBuffer |
putJSON1(java.lang.String name,
byte b) |
AutoBuffer |
putJSON4(int i) |
AutoBuffer |
putJSON4(java.lang.String name,
int i) |
AutoBuffer |
putJSON4f(float f) |
AutoBuffer |
putJSON4f(java.lang.String name,
float f) |
AutoBuffer |
putJSON8(java.lang.String name,
long l) |
AutoBuffer |
putJSON8d(double d) |
AutoBuffer |
putJSON8d(java.lang.String name,
double d) |
AutoBuffer |
putJSONA(Freezable[] fs) |
AutoBuffer |
putJSONA(java.lang.String name,
Freezable[] f) |
AutoBuffer |
putJSONA1(byte[] ary) |
AutoBuffer |
putJSONA1(java.lang.String name,
byte[] b) |
AutoBuffer |
putJSONA2(java.lang.String name,
short[] ary) |
AutoBuffer |
putJSONA4(java.lang.String name,
int[] a) |
AutoBuffer |
putJSONA4f(java.lang.String name,
float[] a) |
AutoBuffer |
putJSONA8(java.lang.String name,
long[] ary) |
AutoBuffer |
putJSONA8d(double[] a) |
AutoBuffer |
putJSONA8d(java.lang.String name,
double[] a) |
AutoBuffer |
putJSONAA(Freezable[][] fs) |
AutoBuffer |
putJSONAA(java.lang.String name,
Freezable[][] f) |
AutoBuffer |
putJSONAA1(java.lang.String name,
byte[][] b) |
AutoBuffer |
putJSONAA4(java.lang.String name,
int[][] a) |
AutoBuffer |
putJSONAA8(java.lang.String name,
long[][] ary) |
AutoBuffer |
putJSONAA8d(double[][] a) |
AutoBuffer |
putJSONAA8d(java.lang.String name,
double[][] a) |
AutoBuffer |
putJSONAAA(Freezable[][][] fs) |
AutoBuffer |
putJSONAAA(java.lang.String name,
Freezable[][][] f) |
AutoBuffer |
putJSONAAA4(java.lang.String name,
int[][][] a) |
AutoBuffer |
putJSONAAA8(java.lang.String name,
long[][][] ary) |
AutoBuffer |
putJSONAAA8d(java.lang.String name,
double[][][] a) |
AutoBuffer |
putJSONAAASer(java.lang.String name,
java.lang.Object[][][] oooo) |
AutoBuffer |
putJSONAASer(java.lang.String name,
java.lang.Object[][] ooo) |
AutoBuffer |
putJSONAAStr(java.lang.String[][] sss) |
AutoBuffer |
putJSONAAStr(java.lang.String name,
java.lang.String[][] sss) |
AutoBuffer |
putJSONAEnum(java.lang.Enum[] enums) |
AutoBuffer |
putJSONAEnum(java.lang.String name,
java.lang.Enum[] enums) |
AutoBuffer |
putJSONASer(java.lang.String name,
java.lang.Object[] oo) |
AutoBuffer |
putJSONAStr(java.lang.String[] ss) |
AutoBuffer |
putJSONAStr(java.lang.String name,
java.lang.String[] ss) |
AutoBuffer |
putJSONAZ(java.lang.String name,
boolean[] f) |
AutoBuffer |
putJSONEnum(java.lang.String name,
java.lang.Enum e) |
AutoBuffer |
putJSONName(java.lang.String s) |
AutoBuffer |
putJSONSer(java.lang.String name,
java.lang.Object o) |
AutoBuffer |
putJSONStr(java.lang.String s) |
AutoBuffer |
putJSONStr(java.lang.String name,
java.lang.String s) |
AutoBuffer |
putJSONStrUnquoted(java.lang.String s) |
AutoBuffer |
putJSONStrUnquoted(java.lang.String name,
java.lang.String s) |
AutoBuffer |
putJSONZ(boolean b) |
AutoBuffer |
putJSONZ(java.lang.String name,
boolean value) |
AutoBuffer |
putKey(Key k) |
AutoBuffer |
putSer(java.lang.Object obj) |
AutoBuffer |
putStr(java.lang.String s) |
AutoBuffer |
putZ(boolean b) |
static byte[] |
serializeBootstrapFreezable(BootstrapFreezable<?> o)
Serializes a BootstrapFreezable into a byte array.
|
void |
skip(int skip)
Skip over some bytes in the byte buffer.
|
java.lang.String |
toString() |
static void |
writeToChannel(AutoBuffer ab,
java.nio.channels.ByteChannel channel) |
public java.lang.String sourceName
public static int TCP_BUF_SIZ
public AutoBuffer(java.nio.channels.ByteChannel sock)
public AutoBuffer(java.nio.channels.ByteChannel sock, java.net.InetAddress remoteAddress, short timestamp)
public AutoBuffer(java.nio.channels.FileChannel fc, boolean read, byte persist)
public AutoBuffer(byte[] buf)
public AutoBuffer()
public AutoBuffer(int len)
bufClose()
to retrieve the final byte[].public AutoBuffer(java.io.OutputStream os, boolean persist)
public AutoBuffer(java.io.InputStream is)
public AutoBuffer(java.io.InputStream is, java.lang.String[] typeMap)
public boolean isClosed()
public java.lang.String toString()
toString
in class java.lang.Object
public final void close()
close
in interface java.lang.AutoCloseable
public int position()
public AutoBuffer position(int p)
public void skip(int skip)
public final byte[] buf()
public final byte[] bufClose()
public AutoBuffer flipForReading()
public java.lang.String getStr(int off, int len)
public boolean getZ()
public byte get1()
public int get1U()
public char get2()
public short get2s()
public int get3()
public int get4()
public float get4f()
public long get8()
public double get8d()
public AutoBuffer putZ(boolean b)
public AutoBuffer put1(int b)
public AutoBuffer put2(char c)
public AutoBuffer put2(short s)
public AutoBuffer put2s(short s)
public AutoBuffer put3(int x)
public AutoBuffer put4(int i)
public AutoBuffer put4f(float f)
public AutoBuffer put8(long l)
public AutoBuffer put8d(double d)
public AutoBuffer put(Freezable f)
public <T extends Freezable> T get()
public <T extends Freezable> T get(java.lang.Class<T> tc)
public AutoBuffer putKey(Key k)
public AutoBuffer putInt(int x)
public int getInt()
public AutoBuffer putAEnum(java.lang.Enum[] enums)
public <E extends java.lang.Enum> E[] getAEnum(E[] values)
public AutoBuffer putA(Freezable[] fs)
public AutoBuffer putAA(Freezable[][] fs)
public AutoBuffer putAAA(Freezable[][][] fs)
public <T extends Freezable> T[] getA(java.lang.Class<T> tc)
public <T extends Freezable> T[][] getAA(java.lang.Class<T> tc)
public <T extends Freezable> T[][][] getAAA(java.lang.Class<T> tc)
public AutoBuffer putAStr(java.lang.String[] fs)
public java.lang.String[] getAStr()
public AutoBuffer putAAStr(java.lang.String[][] fs)
public java.lang.String[][] getAAStr()
public boolean[] getAZ()
public byte[] getA1()
public byte[] getA1(int len)
public short[] getA2()
public int[] getA4()
public float[] getA4f()
public long[] getA8()
public double[] getA8d()
public byte[][] getAA1()
public short[][] getAA2()
public int[][] getAA4()
public float[][] getAA4f()
public long[][] getAA8()
public double[][] getAA8d()
public int[][][] getAAA4()
public long[][][] getAAA8()
public double[][][] getAAA8d()
public java.lang.String getStr()
public <E extends java.lang.Enum> E getEnum(E[] values)
public AutoBuffer putAZ(boolean[] ary)
public AutoBuffer putA1(byte[] ary)
public AutoBuffer putA1(byte[] ary, int length)
public AutoBuffer putA1(byte[] ary, int sofar, int length)
public AutoBuffer putA4(int[] ary)
public AutoBuffer putA8(long[] ary)
public AutoBuffer putA4f(float[] ary)
public AutoBuffer putA8d(double[] ary)
public AutoBuffer putAA1(byte[][] ary)
public AutoBuffer putAA4(int[][] ary)
public AutoBuffer putAA4f(float[][] ary)
public AutoBuffer putAA8(long[][] ary)
public AutoBuffer putAA8d(double[][] ary)
public AutoBuffer putAAA4(int[][][] ary)
public AutoBuffer putAAA8(long[][][] ary)
public AutoBuffer putAAA8d(double[][][] ary)
public AutoBuffer putStr(java.lang.String s)
public AutoBuffer putEnum(java.lang.Enum x)
public static void writeToChannel(AutoBuffer ab, java.nio.channels.ByteChannel channel) throws java.io.IOException
java.io.IOException
public static byte[] serializeBootstrapFreezable(BootstrapFreezable<?> o)
o
- a BootstrapFreezable to serializepublic static BootstrapFreezable<?> deserializeBootstrapFreezable(byte[] bytes)
public static byte[] javaSerializeWritePojo(java.lang.Object o)
public static java.lang.Object javaSerializeReadPojo(byte[] bytes)
public AutoBuffer putSer(java.lang.Object obj)
public AutoBuffer putASer(java.lang.Object[] fs)
public AutoBuffer putAASer(java.lang.Object[][] fs)
public AutoBuffer putAAASer(java.lang.Object[][][] fs)
public java.lang.Object getSer()
public <T> T getSer(java.lang.Class<T> tc)
public <T> T[] getASer(java.lang.Class<T> tc)
public <T> T[][] getAASer(java.lang.Class<T> tc)
public <T> T[][][] getAAASer(java.lang.Class<T> tc)
public AutoBuffer putJNULL()
public AutoBuffer putJSONStrUnquoted(java.lang.String s)
public AutoBuffer putJSONStrUnquoted(java.lang.String name, java.lang.String s)
public AutoBuffer putJSONName(java.lang.String s)
public AutoBuffer putJSONStr(java.lang.String s)
public AutoBuffer putJSONAStr(java.lang.String[] ss)
public AutoBuffer putJSONAAStr(java.lang.String[][] sss)
public AutoBuffer putJSONStr(java.lang.String name, java.lang.String s)
public AutoBuffer putJSONAStr(java.lang.String name, java.lang.String[] ss)
public AutoBuffer putJSONAAStr(java.lang.String name, java.lang.String[][] sss)
public AutoBuffer putJSONSer(java.lang.String name, java.lang.Object o)
public AutoBuffer putJSONASer(java.lang.String name, java.lang.Object[] oo)
public AutoBuffer putJSONAASer(java.lang.String name, java.lang.Object[][] ooo)
public AutoBuffer putJSONAAASer(java.lang.String name, java.lang.Object[][][] oooo)
public AutoBuffer putJSONAZ(java.lang.String name, boolean[] f)
public AutoBuffer putJSON(Freezable ice)
public AutoBuffer putJSONA(Freezable[] fs)
public AutoBuffer putJSONAA(Freezable[][] fs)
public AutoBuffer putJSONAAA(Freezable[][][] fs)
public AutoBuffer putJSON(java.lang.String name, Freezable f)
public AutoBuffer putJSONA(java.lang.String name, Freezable[] f)
public AutoBuffer putJSONAA(java.lang.String name, Freezable[][] f)
public AutoBuffer putJSONAAA(java.lang.String name, Freezable[][][] f)
public AutoBuffer putJSONZ(java.lang.String name, boolean value)
public AutoBuffer putJSON1(byte b)
public AutoBuffer putJSONA1(byte[] ary)
public AutoBuffer putJSON1(java.lang.String name, byte b)
public AutoBuffer putJSONA1(java.lang.String name, byte[] b)
public AutoBuffer putJSONAA1(java.lang.String name, byte[][] b)
public AutoBuffer putJSONAEnum(java.lang.String name, java.lang.Enum[] enums)
public AutoBuffer putJSONAEnum(java.lang.Enum[] enums)
public AutoBuffer putJSONA2(java.lang.String name, short[] ary)
public AutoBuffer putJSON8(java.lang.String name, long l)
public AutoBuffer putJSONEnum(java.lang.String name, java.lang.Enum e)
public AutoBuffer putJSONA8(java.lang.String name, long[] ary)
public AutoBuffer putJSONAA8(java.lang.String name, long[][] ary)
public AutoBuffer putJSONAAA8(java.lang.String name, long[][][] ary)
public AutoBuffer putJSONZ(boolean b)
public AutoBuffer putJSON4(int i)
public AutoBuffer putJSON4(java.lang.String name, int i)
public AutoBuffer putJSONA4(java.lang.String name, int[] a)
public AutoBuffer putJSONAA4(java.lang.String name, int[][] a)
public AutoBuffer putJSONAAA4(java.lang.String name, int[][][] a)
public AutoBuffer putJSON4f(float f)
public AutoBuffer putJSON4f(java.lang.String name, float f)
public AutoBuffer putJSONA4f(java.lang.String name, float[] a)
public AutoBuffer putJSON8d(double d)
public AutoBuffer putJSON8d(java.lang.String name, double d)
public AutoBuffer putJSONA8d(java.lang.String name, double[] a)
public AutoBuffer putJSONAA8d(java.lang.String name, double[][] a)
public AutoBuffer putJSONAAA8d(java.lang.String name, double[][][] a)
public AutoBuffer putJSONA8d(double[] a)
public AutoBuffer putJSONAA8d(double[][] a)