title: Reliance on default encoding
body: <p>I'm using FindBugs and this error keeps generating:</p>
  <blockquote>
  <p>Reliance on default encoding:</p>
  <p>Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. <strong>This will cause the application behavior to vary between platforms.</strong> Use an alternative API and specify a charset name or Charset object explicitly.</p>
  </blockquote>
  <p>I think it has something to do with the Scanner here is my code:</p>
  <pre><code>package mystack;
  
   import java.util.*;
    
    public class MyStack {
     
      private int maxSize;
      private int[] stackArray;
      private int top;
      
      public MyStack(int s) {
         maxSize = s;
         stackArray = new int[maxSize];
         top = -1;
      }
      public void push(int j) {
         stackArray[++top] = j;
      }
      public int pop() {
         return stackArray[top--];
      }
      public int peek() {
         return stackArray[top];
      }
      public int min() {
         return stackArray[0];
      }
      public boolean isEmpty() {
         return (top == -1);
      }
      public boolean isFull() {
         return (top == maxSize - 1);
      }
       
      
       public static void main(String[] args) {
           
         Scanner read = new Scanner(System.in);
  
           char end;
           
           System.out.println(&quot;Please enter the size of the Stack: &quot;);
              int size=read.nextInt();
          
              MyStack stack = new MyStack(size);
           
           do{
           
              if(stack.isEmpty()){
                System.out.println(&quot;Please fill the Stack: (PUSH) \nBecause Stack is Empty.&quot;);
                   int add;
                   for(int i=0; i&lt;size; i++)
                   {add=read.nextInt();
                     stack.push(add);}
                        }//End of if
          
            else if(stack.isFull()){
                System.out.println(&quot;Do you want to 1)POP 2)Know the Peek 3)Know the Min&quot;);
                 int option=read.nextInt();
                  if(option==1) 
                   stack.pop();
                  
                  else if (option==2)
                   System.out.println(&quot;The Peek= &quot;+stack.peek());
                  
                  else if (option==3)
                   System.out.println(&quot;The Min= &quot;+stack.min());
                  
                  else System.out.println(&quot;Error, Choose 1 or 2 or 3&quot;);
                        }//End of if
           else 
              { System.out.println(&quot;Do you want to 1)POP 2)Know the Peek 3)Know the Min 4)PUSH&quot;);
                 int option=read.nextInt();
                   
                   if(option==1)
                       stack.pop();
                  
                   else if (option==2)
                    System.out.println(&quot;The Peek= &quot;+stack.peek());
                   
                   else if (option==3)
                    System.out.println(&quot;The Min= &quot;+stack.min());
                 
                   else if(option==4)
                     {int add=read.nextInt();
                      stack.push(add);}
                     }//end else
          
           System.out.print(&quot;Stack= &quot;);
            for(int i=0; i&lt;=stack.top; i++)
                   { System.out.print(stack.stackArray[i]+&quot; &quot;);}
           
           System.out.println();
           System.out.println();
           
           System.out.println(&quot;Repeat? (e=exit)&quot;);
            end=read.next().charAt(0);
            
           System.out.println();
           }while(end!='e');   
      System.out.println(&quot;End Of Program&quot;);
      }//end main
  
      }//end MyStack
  </code></pre>
  <p>It is a stack obviously, works fine.</p>