All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.reply.IntegerReply Maven / Gradle / Ivy

There is a newer version: 0.12
Show newest version
package redis.reply;

import java.io.IOException;
import java.io.OutputStream;

import redis.RedisProtocol;

/**
* Created by IntelliJ IDEA.
* User: sam
* Date: 7/29/11
* Time: 10:23 AM
* To change this template use File | Settings | File Templates.
*/
public class IntegerReply implements Reply {
  public static final char MARKER = ':';
  private final long integer;

  public IntegerReply(long integer) {
    this.integer = integer;
  }

  @Override
  public Long data() {
    return integer;
  }

  @Override
  public void write(OutputStream os) throws IOException {
    os.write(MARKER);
    os.write(RedisProtocol.toBytes(integer));
    os.write(CRLF);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy