Files
engine/shell/platform/android/io/flutter/plugin/common/BinaryCodec.java
T
Mikkel Nygaard Ravn c4edec7417 Remove old flutter messaging API (#3482)
Breaking change: removed facilities for JSON and string messaging from FlutterView/FlutterViewController, leaving only binary messaging there. All other use of flutter communication now goes through FlutterMessageChannel and FlutterMethodChannels. Retained use of String and JSON codecs for now.

Companion flutter PR: flutter/flutter#8837
2017-03-17 09:04:59 +01:00

29 lines
801 B
Java

// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package io.flutter.plugin.common;
import java.nio.ByteBuffer;
/**
* A {@link MessageCodec} using unencoded binary messages, represented as {@link ByteBuffer}s.
*/
public final class BinaryCodec implements MessageCodec<ByteBuffer> {
// This codec must match the Dart codec of the same name in package flutter/services.
public static final BinaryCodec INSTANCE = new BinaryCodec();
private BinaryCodec() {
}
@Override
public ByteBuffer encodeMessage(ByteBuffer message) {
return message;
}
@Override
public ByteBuffer decodeMessage(ByteBuffer message) {
return message;
}
}