ByteBuffer bytes = ByteBuffer.allocate(Ints.checkedCast(size));
channel.read(bytes);
channel.close();
stream.close();
return bytes.array();
<BUG>}
public static FileUtil.FirstBytes getFirstBytes(File file) throws IOException {</BUG>
return getFirstBytes(file, 511);
<BUG>}
public static FileUtil.FirstBytes getFirstBytes(File file, long maxSize) throws IOException {</BUG>
if (file.isFile()) {

ByteBuffer bytes = ByteBuffer.allocate(Ints.checkedCast(size));
channel.read(bytes);
channel.close();
stream.close();
return bytes.array();
}
@Nonnull
public static FileUtil.FirstBytes getFirstBytes(File file) throws IOException {
return getFirstBytes(file, 511);
}
@Nonnull
public static FileUtil.FirstBytes getFirstBytes(File file, long maxSize) throws IOException {
if (file.isFile()) {
