Package com.impossibl.postgres.utils
Class ByteBufs
- java.lang.Object
-
- com.impossibl.postgres.utils.ByteBufs
-
public class ByteBufs extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceByteBufs.DecodeFunctionstatic interfaceByteBufs.EncodeFunction
-
Constructor Summary
Constructors Constructor Description ByteBufs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.buffer.ByteBuf[]allocAll(io.netty.buffer.ByteBufAllocator alloc, int count)static io.netty.buffer.ByteBuf[]duplicateAll(io.netty.buffer.ByteBuf[] buffers)static io.netty.buffer.ByteBuf[]encode(io.netty.buffer.ByteBufAllocator alloc, java.lang.CharSequence[] textBuffers)static java.lang.ObjectlengthDecode(io.netty.buffer.ByteBuf buffer, ByteBufs.DecodeFunction decode)static java.lang.ObjectlengthDecodeBinary(Type.Codec.Decoder<io.netty.buffer.ByteBuf> decoder, Context context, Type type, java.lang.Short typeLength, java.lang.Integer typeModifier, io.netty.buffer.ByteBuf buffer, java.lang.Class<?> targetClass, java.lang.Object targetContext)static intlengthEncode(io.netty.buffer.ByteBuf buffer, java.lang.Object value, ByteBufs.EncodeFunction encode)static voidlengthEncodeBinary(Type.Codec.Encoder<io.netty.buffer.ByteBuf> encoder, Context context, Type type, java.lang.Object value, java.lang.Object sourceContext, io.netty.buffer.ByteBuf buffer)static java.lang.StringreadCString(io.netty.buffer.ByteBuf buffer, java.nio.charset.Charset charset)static voidreleaseAll(io.netty.buffer.ByteBuf[] byteBufs)static io.netty.buffer.ByteBuf[]retainedDuplicateAll(io.netty.buffer.ByteBuf[] buffers)static voidwriteCString(io.netty.buffer.ByteBuf buffer, byte[] valBytes)static voidwriteCString(io.netty.buffer.ByteBuf buffer, java.lang.String val, java.nio.charset.Charset charset)
-
-
-
Method Detail
-
allocAll
public static io.netty.buffer.ByteBuf[] allocAll(io.netty.buffer.ByteBufAllocator alloc, int count)
-
duplicateAll
public static io.netty.buffer.ByteBuf[] duplicateAll(io.netty.buffer.ByteBuf[] buffers)
-
retainedDuplicateAll
public static io.netty.buffer.ByteBuf[] retainedDuplicateAll(io.netty.buffer.ByteBuf[] buffers)
-
releaseAll
public static void releaseAll(io.netty.buffer.ByteBuf[] byteBufs)
-
encode
public static io.netty.buffer.ByteBuf[] encode(io.netty.buffer.ByteBufAllocator alloc, java.lang.CharSequence[] textBuffers)
-
lengthEncodeBinary
public static void lengthEncodeBinary(Type.Codec.Encoder<io.netty.buffer.ByteBuf> encoder, Context context, Type type, java.lang.Object value, java.lang.Object sourceContext, io.netty.buffer.ByteBuf buffer) throws java.io.IOException
- Throws:
java.io.IOException
-
lengthEncode
public static int lengthEncode(io.netty.buffer.ByteBuf buffer, java.lang.Object value, ByteBufs.EncodeFunction encode) throws java.io.IOException- Throws:
java.io.IOException
-
lengthDecodeBinary
public static java.lang.Object lengthDecodeBinary(Type.Codec.Decoder<io.netty.buffer.ByteBuf> decoder, Context context, Type type, java.lang.Short typeLength, java.lang.Integer typeModifier, io.netty.buffer.ByteBuf buffer, java.lang.Class<?> targetClass, java.lang.Object targetContext) throws java.io.IOException
- Throws:
java.io.IOException
-
lengthDecode
public static java.lang.Object lengthDecode(io.netty.buffer.ByteBuf buffer, ByteBufs.DecodeFunction decode) throws java.io.IOException- Throws:
java.io.IOException
-
readCString
public static java.lang.String readCString(io.netty.buffer.ByteBuf buffer, java.nio.charset.Charset charset)
-
writeCString
public static void writeCString(io.netty.buffer.ByteBuf buffer, java.lang.String val, java.nio.charset.Charset charset)
-
writeCString
public static void writeCString(io.netty.buffer.ByteBuf buffer, byte[] valBytes)
-
-