forked from j62/ctbrec
1
0
Fork 0

Organize imports

This commit is contained in:
0xboobface 2018-09-07 15:43:59 +02:00
parent 017a091d84
commit 5df0c25a9d
4 changed files with 45 additions and 54 deletions

View File

@ -2,9 +2,10 @@ package org.taktik.mpegts;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import com.google.common.base.Preconditions;
import org.taktik.ioutils.NIOUtils; import org.taktik.ioutils.NIOUtils;
import com.google.common.base.Preconditions;
public class MTSPacket extends PacketSupport { public class MTSPacket extends PacketSupport {
private boolean transportErrorIndicator; // Transport Error Indicator (TEI) private boolean transportErrorIndicator; // Transport Error Indicator (TEI)
private boolean payloadUnitStartIndicator; // Payload Unit Start Indicator private boolean payloadUnitStartIndicator; // Payload Unit Start Indicator

View File

@ -1,13 +1,13 @@
package org.taktik.mpegts; package org.taktik.mpegts;
import java.io.File;
import org.taktik.mpegts.sinks.MTSSink; import org.taktik.mpegts.sinks.MTSSink;
import org.taktik.mpegts.sinks.UDPTransport; import org.taktik.mpegts.sinks.UDPTransport;
import org.taktik.mpegts.sources.MTSSource; import org.taktik.mpegts.sources.MTSSource;
import org.taktik.mpegts.sources.MTSSources; import org.taktik.mpegts.sources.MTSSources;
import org.taktik.mpegts.sources.ResettableMTSSource; import org.taktik.mpegts.sources.ResettableMTSSource;
import java.io.File;
public class StreamerTest { public class StreamerTest {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {

View File

@ -1,37 +1,33 @@
package org.taktik.mpegts.sources; package org.taktik.mpegts.sources;
import java.io.IOException; import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel; import java.nio.channels.ByteChannel;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import org.taktik.ioutils.NIOUtils;
import org.taktik.mpegts.Constants;
import org.taktik.mpegts.MTSPacket;
public class ByteChannelMTSSource extends AbstractByteChannelMTSSource<ByteChannel> { public class ByteChannelMTSSource extends AbstractByteChannelMTSSource<ByteChannel> {
private ByteChannelMTSSource(ByteChannel byteChannel) throws IOException { private ByteChannelMTSSource(ByteChannel byteChannel) throws IOException {
super(byteChannel); super(byteChannel);
} }
public static ByteChannelMTSSourceBuilder builder() { public static ByteChannelMTSSourceBuilder builder() {
return new ByteChannelMTSSourceBuilder(); return new ByteChannelMTSSourceBuilder();
} }
public static class ByteChannelMTSSourceBuilder { public static class ByteChannelMTSSourceBuilder {
private ByteChannel byteChannel; private ByteChannel byteChannel;
private ByteChannelMTSSourceBuilder(){} private ByteChannelMTSSourceBuilder(){}
public ByteChannelMTSSourceBuilder setByteChannel(ByteChannel byteChannel) { public ByteChannelMTSSourceBuilder setByteChannel(ByteChannel byteChannel) {
this.byteChannel = byteChannel; this.byteChannel = byteChannel;
return this; return this;
} }
public ByteChannelMTSSource build() throws IOException { public ByteChannelMTSSource build() throws IOException {
Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null"); Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null");
return new ByteChannelMTSSource(byteChannel); return new ByteChannelMTSSource(byteChannel);
} }
} }
} }

View File

@ -1,45 +1,39 @@
package org.taktik.mpegts.sources; package org.taktik.mpegts.sources;
import java.io.IOException; import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SeekableByteChannel; import java.nio.channels.SeekableByteChannel;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.taktik.ioutils.NIOUtils;
import org.taktik.mpegts.Constants;
import org.taktik.mpegts.MTSPacket;
public class SeekableByteChannelMTSSource extends AbstractByteChannelMTSSource<SeekableByteChannel> implements ResettableMTSSource { public class SeekableByteChannelMTSSource extends AbstractByteChannelMTSSource<SeekableByteChannel> implements ResettableMTSSource {
private SeekableByteChannelMTSSource(SeekableByteChannel byteChannel) throws IOException { private SeekableByteChannelMTSSource(SeekableByteChannel byteChannel) throws IOException {
super(byteChannel); super(byteChannel);
} }
public static SeekableByteChannelMTSSourceBuilder builder() { public static SeekableByteChannelMTSSourceBuilder builder() {
return new SeekableByteChannelMTSSourceBuilder(); return new SeekableByteChannelMTSSourceBuilder();
} }
@Override @Override
public void reset() throws IOException { public void reset() throws IOException {
byteChannel.position(0); byteChannel.position(0);
fillBuffer(); fillBuffer();
} }
public static class SeekableByteChannelMTSSourceBuilder { public static class SeekableByteChannelMTSSourceBuilder {
private SeekableByteChannel byteChannel; private SeekableByteChannel byteChannel;
private SeekableByteChannelMTSSourceBuilder(){} private SeekableByteChannelMTSSourceBuilder(){}
public SeekableByteChannelMTSSourceBuilder setByteChannel(SeekableByteChannel byteChannel) { public SeekableByteChannelMTSSourceBuilder setByteChannel(SeekableByteChannel byteChannel) {
this.byteChannel = byteChannel; this.byteChannel = byteChannel;
return this; return this;
} }
public SeekableByteChannelMTSSource build() throws IOException { public SeekableByteChannelMTSSource build() throws IOException {
Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null"); Preconditions.checkNotNull(byteChannel, "byteChannel cannot be null");
return new SeekableByteChannelMTSSource(byteChannel); return new SeekableByteChannelMTSSource(byteChannel);
} }
} }
} }