Index: BSQFileSystemServerProvider.java
===================================================================
--- BSQFileSystemServerProvider.java	(revision 43875)
+++ BSQFileSystemServerProvider.java	(revision 43876)
@@ -22,42 +22,44 @@
  */
 package org.gvsig.fmap.dal.file.bsq;
 
+import java.io.DataOutputStream;
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteOrder;
 import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+import org.gvsig.basicformats.FormatsFile;
+import org.gvsig.basicformats.HDRFile;
 
 import org.gvsig.fmap.dal.DataServerExplorer;
 import org.gvsig.fmap.dal.NewDataStoreParameters;
 import org.gvsig.fmap.dal.exception.CreateException;
 import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.raster.NewRasterStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
 import org.gvsig.fmap.dal.serverexplorer.filesystem.impl.AbstractFilesystemServerExplorerProvider;
+import org.gvsig.raster.lib.buffer.api.Band;
+import org.gvsig.raster.lib.buffer.api.Buffer;
+import org.gvsig.raster.lib.buffer.api.BufferDimensions;
+import org.gvsig.raster.lib.buffer.api.BufferManager;
 
 public class BSQFileSystemServerProvider extends AbstractFilesystemServerExplorerProvider {
 
     protected String[] fileExtensions;
-    protected boolean canCreate;
 
     public BSQFileSystemServerProvider(
-            String name, 
-            String description, 
+            String name,
+            String description,
             String[] fileExtensions
-        ) {
-        this(name, description, fileExtensions, false);
-    }
-    
-    public BSQFileSystemServerProvider(
-            String name, 
-            String description, 
-            String[] fileExtensions,
-            boolean canCreate
-        ) {
+    ) {
         super(name, description);
         this.fileExtensions = fileExtensions;
-        this.canCreate = canCreate;
     }
-    
+
     @Override
     public boolean canCreate() {
-        return canCreate;
+        return true;
     }
 
     @Override
@@ -67,9 +69,81 @@
 
     @Override
     public void create(NewDataStoreParameters parameters, boolean overwrite) throws CreateException {
-        throw new UnsupportedOperationException();
+        FileOutputStream fos = null;
+        try {
+            Buffer buffer = ((NewRasterStoreParameters) parameters).getBuffer();
+            if (!buffer.areAllBandsOfTheSameType()) {
+                throw new IllegalArgumentException("The BSQ format does not support bands of different types.");
+            }
+            BufferDimensions dimensions = buffer.getDimensions();
+            File file = ((FilesystemStoreParameters) parameters).getFile();
+            fos = new FileOutputStream(file);
+            DataOutputStream dos = new DataOutputStream(fos);
+            HDRFile hdr = FormatsFile.createHDRFile();
+            hdr.setDataType(buffer.getBandTypes()[0]);
+            hdr.setNBands(buffer.getBandCount());
+            hdr.setByteOrder(ByteOrder.nativeOrder());
+            hdr.setDimensions(
+                    dimensions.getRows(),
+                    dimensions.getColumns(),
+                    dimensions.getEnvelope()
+            );
+            for (int nband = 0; nband < buffer.getBandCount(); nband++) {
+                writeBand(dos, buffer.getBand(nband));
+            }
+            hdr.write(file);
+        } catch (Exception ex) {
+            throw new CreateException(this.getName(), ex);
+        } finally {
+            IOUtils.closeQuietly(fos);
+        }
     }
-        
+
+    void writeBand(DataOutputStream dos, Band band) throws IOException {
+        int dataType = band.getDataType();
+        Object rowBuffer = band.createRowBuffer();
+        for (int row = 0; row < band.getRows(); row++) {
+            band.fetchRow(row, rowBuffer);
+            switch (dataType) {
+                case BufferManager.TYPE_BYTE:
+                    byte[] byteBuffer = (byte[]) rowBuffer;
+                    for (int n = 0; n < byteBuffer.length; n++) {
+                        dos.writeByte(byteBuffer[n]);
+                    }
+                    break;
+                case BufferManager.TYPE_SHORT:
+                case BufferManager.TYPE_USHORT:
+                    short[] shortBuffer = (short[]) rowBuffer;
+                    for (int n = 0; n < shortBuffer.length; n++) {
+                        dos.writeShort(shortBuffer[n]);
+                    }
+                    break;
+                case BufferManager.TYPE_INT:
+                    int[] intBuffer = (int[]) rowBuffer;
+                    for (int n = 0; n < intBuffer.length; n++) {
+                        dos.writeInt(intBuffer[n]);
+                    }
+                    break;
+                case BufferManager.TYPE_FLOAT:
+                    float[] floatBuffer = (float[]) rowBuffer;
+                    for (int n = 0; n < floatBuffer.length; n++) {
+                        dos.writeFloat(floatBuffer[n]);
+                    }
+                    break;
+
+                case BufferManager.TYPE_DOUBLE:
+                    double[] doubleBuffer = (double[]) rowBuffer;
+                    for (int n = 0; n < doubleBuffer.length; n++) {
+                        dos.writeDouble(doubleBuffer[n]);
+                    }
+                    break;
+
+                default:
+                    throw new IllegalArgumentException("Data Type " + dataType + " not supported.");
+            }
+        }
+    }
+
     @Override
     public int getMode() {
         return DataServerExplorer.MODE_RASTER;
