@Override
    public ResponseMessage readChunk(final ByteBuf byteBuf, final boolean isFirstChunk) throws SerializationException {
        final Buffer buffer = bufferFactory.create(byteBuf);
        boolean bulking = false;

        try {
            // empty input buffer
            if (buffer.readableBytes() == 0) {
                return ResponseMessage.build().result(Collections.emptyList()).create();
            }

            if (isFirstChunk) {
                final int version = buffer.readByte() & 0xff;

                if (version >>> 7 != 1) {
                    // This is an indication that the response buffer was incorrectly built
                    // Or the buffer offsets are wrong
                    throw new SerializationException("The most significant bit should be set according to the format");
                }
                bulking = (buffer.readByte() & 1) == 1;
            }

            final List<Object> result = readPayload(buffer);

            // no footer
            if (buffer.readableBytes() == 0) {
                return ResponseMessage.build()
                        .result(result)
                        .bulked(bulking)
                        .create();
            }

            final Triplet<HttpResponseStatus, String, String> footer = readFooter(buffer);
            return ResponseMessage.build()
                    .result(result)
                    .bulked(bulking)
                    .code(footer.getValue0())
                    .statusMessage(footer.getValue1())
                    .exception(footer.getValue2())
                    .create();

        } catch (IOException | IndexOutOfBoundsException ex) {
            throw new SerializationException(ex);
        }
    }
Creates a new instance of the message serializer using the default type serializers.
gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphBinaryMessageSerializerV4.java