Getting the Maximum Size of a Preference Key and Value - Java Native OS

Java examples for Native OS:Preference

Description

Getting the Maximum Size of a Preference Key and Value

Demo Code

import java.util.prefs.Preferences;

public class Main {
  public static void main(String[] argv) {
    // Get maximum key length
    int keyMax = Preferences.MAX_KEY_LENGTH;

    // Get maximum value length
    int valueMax = Preferences.MAX_VALUE_LENGTH;

    // Get maximum length of byte array values
    int bytesMax = Preferences.MAX_VALUE_LENGTH * 3 / 4;
  }//  w  ww .j  av  a  2  s. co  m
}

Related Tutorials