java - nullpointer exception
<p>Guys i need some help here , im getting this error here at the  code snippet below. 
here's the stack trace. i have a feeling that somebody's gonna say not much effort on my part. its ok i agree , give me a suggestion what should i do more and ill do it just that i've got a little stuck and not moving ahead so thought of posting it here.</p>

<p>i think i'm having a problem because i'm using a code that was used for writing an excel file when the size of content to write to excel was pre - known . what i actually need is some way to write to excel when the length of rows and collumns may vary .</p>

<pre><code>Length of Array:2000
java.lang.NullPointerException
    at org.temp2.cod2.WriteToExcel.setExcel(WriteToExcel.java:149) &gt;&gt; line 149 is last line of the code snippet below i.e. byte buf[] = s.getBytes();
</code></pre>

<p>here the code snippet</p>

<pre><code>String data[][] = new String [2000][5];

System.out.println("Length of Array:"+data.length);

for(int j=0;j&lt;colN.length;j++){
    Label myLabel1=new Label(j,1,colVal[j]);
    wst.addCell(myLabel1);
}

for(int i=2;i&lt;=data.length+1;i++){
    for(int j=0;j&lt;colN.length;j++)
    {
            // Encrypt
            encrypter.encrypt(new FileInputStream("C:\\Users\\abc\\Desktop\\Encrypted.txt"),new FileOutputStream("temp.txt"));
            // Decrypt

            ByteArrayOutputStream f = new ByteArrayOutputStream();
            String s = data[i-2][j];
            byte buf[] = s.getBytes();
</code></pre>
