<commit_before>package edu.uw.apl.tupelo.model;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;

import edu.uw.apl.nativelibloader.NativeLoader;

/*
  TODO: the JNI code needed for deriving device size in bytes and disk
  serial id (aka vendor ID).  We have this, just cut/paste here
*/

public class PhysicalDisk implements UnmanagedDisk {

	public PhysicalDisk( File f ) throws IOException {
		if( f == null )
			throw new IllegalArgumentException( "Null file!" );

		/*
		  Fail early with IOException if no such file, before jni...
		*/
		FileInputStream fis = new FileInputStream( f );
		fis.close();

		// Java reports 0 for the size of a device file...
		long len = f.length();
		if( len != 0 )
			throw new IllegalArgumentException( f + ": Unexpected length "
												+ len );
		disk = f;
	}

	public long size() {
		return size( disk.getPath() );
	}

	public String getID() {
		String v = vendorID( disk.getPath() );
		if( v != null )
			v = v.trim();
		String p = productID( disk.getPath() );
		if( p != null )
			p = p.trim();
		String s = serialNumber( disk.getPath() );
		if( s != null )
			s = s.trim();
		return v + "/" + p + "/" + s;
	}
	
	@Override
	public InputStream getInputStream() throws IOException {
		if( true) {
			return new FileInputStream( disk );
		} else {
			FileInputStream fis = new FileInputStream( disk );
			int sz = 1024 * 1024 * 32;
			BufferedInputStream bis = new BufferedInputStream( fis, sz );
			return bis;
		}<commit_msg>physical id used / in name, clashes with file separator<commit_after>package edu.uw.apl.tupelo.model;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;

import edu.uw.apl.nativelibloader.NativeLoader;

/*
  TODO: the JNI code needed for deriving device size in bytes and disk
  serial id (aka vendor ID).  We have this, just cut/paste here
*/

public class PhysicalDisk implements UnmanagedDisk {

	public PhysicalDisk( File f ) throws IOException {
		if( f == null )
			throw new IllegalArgumentException( "Null file!" );

		/*
		  Fail early with IOException if no such file, before jni...
		*/
		FileInputStream fis = new FileInputStream( f );
		fis.close();

		// Java reports 0 for the size of a device file...
		long len = f.length();
		if( len != 0 )
			throw new IllegalArgumentException( f + ": Unexpected length "
												+ len );
		disk = f;
	}

	public long size() {
		return size( disk.getPath() );
	}

	public String getID() {
		String v = vendorID( disk.getPath() );
		if( v != null )
			v = v.trim();
		String p = productID( disk.getPath() );
		if( p != null )
			p = p.trim();
		String s = serialNumber( disk.getPath() );
		if( s != null )
			s = s.trim();
		return v + "-" + p + "-" + s;
	}
	
	@Override
	public InputStream getInputStream() throws IOException {
		if( true) {
			return new FileInputStream( disk );
		} else {
			FileInputStream fis = new FileInputStream( disk );
			int sz = 1024 * 1024 * 32;
			BufferedInputStream bis = new BufferedInputStream( fis, sz );
			return bis;
		}
{'fraction_non_alphanumeric': 0.1220125786163522, 'fraction_numerical': 0.007547169811320755, 'mean_word_length': 3.093951093951094, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '262036', 'n_tokens_mistral': 1142, 'n_tokens_neox': 993, 'n_words': 346}