Package com.impossibl.postgres.utils
Class ByteBufs
- java.lang.Object
-
- com.impossibl.postgres.utils.ByteBufs
-
public class ByteBufs extends 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, CharSequence[] textBuffers)static ObjectlengthDecode(io.netty.buffer.ByteBuf buffer, ByteBufs.DecodeFunction decode)static ObjectlengthDecodeBinary(Type.Codec.Decoder<io.netty.buffer.ByteBuf> decoder, Context context, Type type, Short typeLength, Integer typeModifier, io.netty.buffer.ByteBuf buffer, Class<?> targetClass, Object targetContext)static intlengthEncode(io.netty.buffer.ByteBuf buffer, Object value, ByteBufs.EncodeFunction encode)static voidlengthEncodeBinary(Type.Codec.Encoder<io.netty.buffer.ByteBuf> encoder, Context context, Type type, Object value, Object sourceContext, io.netty.buffer.ByteBuf buffer)static StringreadCString(io.netty.buffer.ByteBuf buffer, 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, String val, 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, CharSequence[] textBuffers)
-
lengthEncodeBinary
public static void lengthEncodeBinary(Type.Codec.Encoder<io.netty.buffer.ByteBuf> encoder, Context context, Type type, Object value, Object sourceContext, io.netty.buffer.ByteBuf buffer) throws IOException
- Throws:
IOException
-
lengthEncode
public static int lengthEncode(io.netty.buffer.ByteBuf buffer, Object value, ByteBufs.EncodeFunction encode) throws IOException- Throws:
IOException
-
lengthDecodeBinary
public static Object lengthDecodeBinary(Type.Codec.Decoder<io.netty.buffer.ByteBuf> decoder, Context context, Type type, Short typeLength, Integer typeModifier, io.netty.buffer.ByteBuf buffer, Class<?> targetClass, Object targetContext) throws IOException
- Throws:
IOException
-
lengthDecode
public static Object lengthDecode(io.netty.buffer.ByteBuf buffer, ByteBufs.DecodeFunction decode) throws IOException
- Throws:
IOException
-
writeCString
public static void writeCString(io.netty.buffer.ByteBuf buffer, String val, Charset charset)
-
writeCString
public static void writeCString(io.netty.buffer.ByteBuf buffer, byte[] valBytes)
-
-