Here you can find the source of roundFileLength(long nbytes)
Parameter | Description |
---|---|
nbytes | a parameter |
public static long roundFileLength(long nbytes)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .ja v a 2s . c o m*/ * @param nbytes * @return * @see default 'io.bytes.per.checksum' property */ public static long roundFileLength(long nbytes) { if (nbytes <= 0) return 0; else if (nbytes <= 512) return nbytes; else if (nbytes % 512 == 0) return nbytes; else return (int) (nbytes / 512 + 1) * 512; } }