diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-02 22:12:44 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-02 22:12:44 +1200 |
commit | 06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07 (patch) | |
tree | 8f5d7b71ca3fa39448e93b3d0652a7fa8d496932 /src/org/traccar/database/MediaManager.java | |
parent | 5a9811c3771d92832c9bba718b5ec935844978e8 (diff) | |
download | trackermap-server-06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07.tar.gz trackermap-server-06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07.tar.bz2 trackermap-server-06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07.zip |
Start Netty 4 migration
Diffstat (limited to 'src/org/traccar/database/MediaManager.java')
-rw-r--r-- | src/org/traccar/database/MediaManager.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/database/MediaManager.java b/src/org/traccar/database/MediaManager.java index 482442735..0bb6afac7 100644 --- a/src/org/traccar/database/MediaManager.java +++ b/src/org/traccar/database/MediaManager.java @@ -15,7 +15,7 @@ */ package org.traccar.database; -import org.jboss.netty.buffer.ChannelBuffer; +import io.netty.buffer.ByteBuf; import org.traccar.helper.Log; import java.io.File; @@ -46,13 +46,13 @@ public class MediaManager { return filePath.toFile(); } - public String writeFile(String uniqueId, ChannelBuffer buf, String extension) { + public String writeFile(String uniqueId, ByteBuf buf, String extension) { if (path != null) { int size = buf.readableBytes(); String name = new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + "." + extension; try (FileOutputStream output = new FileOutputStream(createFile(uniqueId, name)); FileChannel fileChannel = output.getChannel()) { - ByteBuffer byteBuffer = buf.toByteBuffer(); + ByteBuffer byteBuffer = buf.nioBuffer(); int written = 0; while (written < size) { written += fileChannel.write(byteBuffer); |