use of com.codename1.io.BufferedOutputStream in project CodenameOne by codenameone.
the class AndroidImplementation method openOutputStream.
/**
* @inheritDoc
*/
public OutputStream openOutputStream(Object connection, int offset) throws IOException {
String con = (String) connection;
con = removeFilePrefix(con);
RandomAccessFile rf = new RandomAccessFile(con, "rw");
rf.seek(offset);
FileOutputStream fc = new FileOutputStream(rf.getFD());
BufferedOutputStream o = new BufferedOutputStream(fc, con);
o.setConnection(rf);
return o;
}
use of com.codename1.io.BufferedOutputStream in project CodenameOne by codenameone.
the class AndroidImplementation method openOutputStream.
/**
* @inheritDoc
*/
public OutputStream openOutputStream(Object connection) throws IOException {
if (connection instanceof String) {
String con = (String) connection;
if (con.startsWith("file://")) {
con = con.substring(7);
}
OutputStream fc = createFileOuputStream((String) con);
BufferedOutputStream o = new BufferedOutputStream(fc, (String) con);
return o;
}
return new BufferedOutputStream(((URLConnection) connection).getOutputStream(), connection.toString());
}
use of com.codename1.io.BufferedOutputStream in project CodenameOne by codenameone.
the class IOSImplementation method openOutputStream.
/**
* @inheritDoc
*/
public OutputStream openOutputStream(Object connection) throws IOException {
if (connection instanceof String) {
BufferedOutputStream o = new BufferedOutputStream(new NSDataOutputStream((String) connection), (String) connection);
return o;
}
NetworkConnection n = (NetworkConnection) connection;
n.body = new FileBackedOutputStream();
return new BufferedOutputStream(n.body);
}
use of com.codename1.io.BufferedOutputStream in project CodenameOne by codenameone.
the class GameCanvasImplementation method openOutputStream.
/**
* @inheritDoc
*/
public OutputStream openOutputStream(Object connection, int offset) throws IOException {
FileConnection fc = (FileConnection) Connector.open((String) connection, Connector.READ_WRITE);
if (!fc.exists()) {
fc.create();
}
BufferedOutputStream o = new BufferedOutputStream(fc.openOutputStream(offset), (String) connection);
o.setConnection(fc);
return o;
}
use of com.codename1.io.BufferedOutputStream in project CodenameOne by codenameone.
the class BlackBerryOS5Implementation method openOutputStream.
/**
* (non-Javadoc)
*
* @see
* com.codename1.impl.blackberry.BlackBerryImplementation#openOutputStream(java.lang.Object)
*/
public OutputStream openOutputStream(Object connection) throws IOException {
if (connection instanceof String) {
return super.openOutputStream(connection);
}
OutputStream os = ((HttpConnection) connection).openOutputStream();
// getSoftwareVersion() not available in legacy port,introduced at API 4.3.0
int majorVersion = DeviceInfo.getSoftwareVersion().charAt(0) - '0';
// in version 7, BBOS started supporting HTTP 1.1, so facade not required.
if (majorVersion < 7) {
os = new BlackBerryOutputStream(os);
}
return new BufferedOutputStream(os, ((HttpConnection) connection).getURL());
}
Aggregations