예제 #1
0
 public static PageInfo decodePageInfo(ByteChannel chan) throws IOException {
   PageInfo pi = new PageInfo();
   pi.setPageNumber(Dlugosz.readLong(chan));
   pi.setLength(Dlugosz.readLong(chan));
   pi.setByteOffset(Dlugosz.readLong(chan));
   pi.setTimeOffset(Dlugosz.readLong(chan));
   return pi;
 }
예제 #2
0
 public static int encodedPageInfoSize(PageInfo pi) {
   return Dlugosz.bytesToEncode(pi.getPageNumber())
       + Dlugosz.bytesToEncode(pi.getByteOffset())
       + Dlugosz.bytesToEncode(pi.getTimeOffset())
       + Dlugosz.bytesToEncode(pi.getLength());
 }
예제 #3
0
 public static void encodePageInfo(PageInfo pi, ByteBuffer buf) {
   Dlugosz.encode(pi.getPageNumber(), buf);
   Dlugosz.encode(pi.getLength(), buf);
   Dlugosz.encode(pi.getByteOffset(), buf);
   Dlugosz.encode(pi.getTimeOffset(), buf);
 }