class BytesRefSizedReader implements SizedReader<BytesRef>, Marshallable, ReadResolvable<BytesRefSizedReader> {

    public static final BytesRefSizedReader INSTANCE = new BytesRefSizedReader();

    private BytesRefSizedReader() {
    }

    @NotNull
    @Override
    @SuppressWarnings({"rawtypes"})
    public BytesRef read(Bytes in, long size, @Nullable BytesRef using) {<FILL_FUNCTION_BODY>}

    @Override
    public void writeMarshallable(@NotNull WireOut wireOut) {
        // no fields to write
    }

    @Override
    public void readMarshallable(@NotNull WireIn wireIn) {
        // no fields to read
    }

    @NotNull
    @Override
    public BytesRefSizedReader readResolve() {
        return INSTANCE;
    }

}

        if (size < 0L || size > Integer.MAX_VALUE) {
            throw new IORuntimeException("byte[] size should be non-negative int, " +
                    size + " given. Memory corruption?");
        }
        int arrayLength = (int) size;
        using = Optional.ofNullable(using)
                .orElseGet( () ->
                        new BytesRef(new byte[arrayLength])
                );
        if (using.bytes.length < arrayLength) {
            using.bytes = new byte[arrayLength];
        }
        in.read(using.bytes, 0, arrayLength);
        using.offset = 0;
        using.length = arrayLength;
        return using;
    
<no_super_class>